tsoHost Help Centre

Table of Contents

How to make .htm and .html files execute as PHP

Updated Oct 31st, 2017 at 11:36 GMT

To execute a .htm or .html file as if it were a PHP script, you just need to add the following line to a .htaccess file in the directory:

AddType x-httpd-php .htm .html

This will make any PHP code enclosed within <? and ?> in the file execute as if it were a normal PHP file.