开发者

Have an issue using .htaccess to change HTML to PHP

开发者 https://www.devze.com 2023-03-16 13:30 出处:网络
I have a site with loads of html files but some of them require little PHP functions. I have heard that .htaccess can handle this and I tried the code below ...

I have a site with loads of html files but some of them require little PHP functions. I have heard that .htaccess can handle this and I tried the code below ...

RemoveHandler .html .htm
AddType application/x-开发者_运维百科httpd-php .php .htm .html

... but when I do this if I open an page it asks me to download the .PHP file


This suggests that you do not have mod_php installed or enabled.

The web server needs to know how to handle PHP as well as what files you want it to handle as PHP.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号