How to parse PHP within a .html or .htm file


Written by Dennis Nind

Last published at: April 9th, 2019

You may want a .html file to contain PHP scripts / syntax, but want to still use the .html extension. In those cases, you will need to add the additional handler to your .htaccess file...

AddType application/x-httpd-lsphp .php5 .php4 .php .php3 .php2 .phtml .html .htm
AddHandler application/x-httpd-lsphp .php5 .php4 .php .php3 .php2 .phtml .html .htm