我正在为Apache服务器编程,我只需要一个特定的html页面(比如,first.htm)作为PHP脚本进行处理。可以设置吗?
也可以
使用SetHandler
指令:
强制处理程序处理所有匹配的文件
当放入 .htaccess 文件或 部分,此指令强制解析所有匹配的文件 由处理程序名称给出的处理程序。
<Files first.htm>
SetHandler application/x-httpd-php
</Files>
创建一个名为 .htaccess
的文件,并将其放在该文件所在的目录中。将此行添加到 ti:
<Files first.htm>
AddType application/x-httpd-php .htm
</Files>
<Files first.htm>
ForceType application/x-httpd-php
</Files>