1

Run PHP from a .html extension

Posted by Darren on Sep 21, 2009 in Coding, PHP

I recently had an odd request, they wanted their site to appear as HTML but run PHP; my first thought was why? but, if thats what they want, thats what they get.

It turned out to be a very simple task. If you open up your .htaccess file and add the following line:

AddType application/x-httpd-php .html

.html will execute as PHP!

Job done. :)

Tags: , ,