将AddType htaccess的会导致页面下载 [英] AddType in htaccess causes page to download

查看:160
本文介绍了将AddType htaccess的会导致页面下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过这样的约10个问题,但似乎没有回答这个简单的问题。

I have read about 10 questions like this, but there seems to be no answer to this simple question.

什么会导致.htm文件被下载,而不是作为PHP执行?

What could cause .htm files to be downloading instead of executed as php?

我使用下面的code:

I am using the following code:

AddType application/x-httpd-php htm

我已经尝试了多种组合,但没有成功。

I have tried many combinations but no success.

我还可以尝试一下呢?

我需要的是名为.htm和.html文件执行PHP。

All I need is .htm and .html files to execute php.

推荐答案

使用的AddHandler 另外,更改 HTM 热媒并添加的.html

Use AddHandler also, change htm to .htm and add .html

AddHandler application/x-httpd-php .htm .html
AddType application/x-httpd-php .htm .html

http://www.suffix.be/blog/addhandler-addtype-directives

这篇关于将AddType htaccess的会导致页面下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆