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.


htmhtmlPHP

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

Not a problem - our 24/7 customer support team are super friendly and here to help answer all your questions. There's no need to wait, click below to start a Live Chat.

Start Live Chat

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

Not a problem - our 24/7 customer support team are super friendly and here to help answer all your questions. Don't delay, click below to find out how you can get in touch.

Get in Touch