I need to run all of my .html files as .php files and I don\'t have time to change all of the links before our presentation tomorrow. Is there any way to \"hack\" this with
Using @Marc-François approach Firefox prompted me to download the html file
Finally the following is working for me (using both):
AddType application/x-httpd-php .htm .html
AddHandler x-httpd-php .htm .html
I think this is the best way to run php script on html and htm pages:
AddType application/x-httpd-php5 .html .htm
Running .html files as php stopped working all of a sudden in my .htaccess file.
Godaddy support had me change it to:
AddHandler application/x-httpd-lsphp .html
On Dreamhost Servers you can refer to this page that at time of writing indicates you may use the following for php 7.2 with FastCGI:
AddHandler fcgid-script .html
FcgidWrapper "/dh/cgi-system/php72.cgi" .html
Or if you are using php5 cgi (not FastCGI):
AddHandler php5-cgi .html
For anyone out there still having trouble,
try this (my hosting was from Godaddy and this is the only thing that worked for me among all the answers out there.
AddHandler x-httpd-php5-cgi .html
I'm using PHP7.1 running in my Raspberry Pi 3.
In the file /etc/apache2/mods-enabled/php7.1.conf
I added at the end:
AddType application/x-httpd-php .html .htm .png .jpg .gif