Tsohost Knowledge Base

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

Modified Monday 18th August, 2014 at 10:53

Was this helpful?

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.


Still can't find what you're looking for?

That's not a problem. Our 24/7 customer support team are friendly and waiting to help answer your questions. The easiest way to get in touch is to raise a support ticket; simply click the button below.

Open Support Ticket