Process HTML files as PHP files

 In your .htaccess file (*nix servers only) you will need to place the following two lines:

AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html

From here on out your .htm and .html pages will be processed as PHP files by your web server but without actually having to use the .php extension on a given web page to run PHP code.  Pretty handy stuff if I do say so myself - this way you don’t have to 301 redirect a bunch of html pages if you wanted to start utilizing PHP

to pull in some template code within your existing html files. 


Post new comment

The content of this field is kept private and will not be shown publicly.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 5 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.