【发布时间】:2011-06-12 22:49:17
【问题描述】:
我正在尝试解析 .HTML 文件中的 PHP 代码。
我已将以下代码添加到根文件夹中的 .htaccess 文件中:
...
<FilesMatch "\.(htm|html|php)$">
SetHandler application/x-httpd-php5
</FilesMatch>
...
当我进行此更改时,根文件夹之外的所有文件都可以正常工作。
也就是说,这些 html 文件可以正确解析 PHP,没有任何问题:
- somedomain/contact/index.html
- somedomain/about-us/index.html
虽然主页不是:
- somedomain/index.html
任何帮助将不胜感激。
谢谢。 V
【问题讨论】:
标签: php html apache parsing .htaccess