服务器不能解析的.html为PHP [英] Server not parsing .html as PHP
本文介绍了服务器不能解析的.html为PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有包括code。在我的.htaccess文件,但PHP code我试图包括无法正常工作。
选项+包括
将AddType text / html的的.htm的.html
的AddHandler服务器解析的.htm的.html
将AddType应用/八位字节流的.vcf
AddOutputFilterByType DEFLATE text / html的文/ HTM文本/纯文本/ CSS文本/ PHP的文/ JavaScript的应用程序/ x-javascript的
解决方案
尝试:
将AddType应用/ X的httpd - PHP的。html的热媒
更新1
这可能是PHP版本特有的。如果你正在使用PHP5尝试:
将AddType应用/的X的httpd-PHP5的.html的.htm
更新2
尝试:
RemoveHandler的.html的.htm
将AddType应用/ X的httpd - PHP的.php的.htm的.html
还是这里的另一种选择方式做到这一点:
< FilesMatch\ html的$>
ForceType指令应用/ X的httpd - PHP
< / FilesMatch>
I have the included code in my .htaccess file but the php code I am attempting to include is not working.
Options +Includes
AddType text/html .htm .html
AddHandler server-parsed .htm .html
AddType application/octet-stream .vcf
AddOutputFilterByType DEFLATE text/html text/htm text/plain text/css text/php text/javascript application/x-javascript
解决方案
Try:
AddType application/x-httpd-php .html .htm
UPDATE 1
It may be PHP version specific. If you're using PHP5 try:
AddType application/x-httpd-php5 .html .htm
UPDATE 2
Try:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
Or here's yet another alternative way to do this:
<FilesMatch "\.html$">
ForceType application/x-httpd-php
</FilesMatch>
这篇关于服务器不能解析的.html为PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文