Nobby
Nobby

Reputation: 25

Have an issue using .htaccess to change HTML to PHP

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

Upvotes: 1

Views: 312

Answers (1)

Quentin
Quentin

Reputation: 943561

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.

Upvotes: 3

Related Questions