Parsing HTML files as PHP

Yes, if your webserver is running php as Apache module.

If your webserver is running PHP as CGI, use this instead:

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

Or, you could use this simple rewrite rule:

RewriteEngine on 
RewriteRule ^(.*)\.html $1\.php

Leave a Comment