我已经阅读了大约 10 个这样的问题,但是这个简单的问题似乎没有答案。
什么会导致 .htm 文件被下载而不是作为 php 执行?
我正在使用以下代码:
AddType application/x-httpd-php htm
我尝试了很多组合,但都没有成功。
我还能尝试什么?
我只需要 .htm 和 .html 文件来执行 php。
最佳答案
同样使用AddHandler
,将htm
更改为.htm
并添加.html
AddHandler application/x-httpd-php .htm .html
AddType application/x-httpd-php .htm .html
关于php - htaccess 中的 AddType 导致页面下载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17024272/