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: , ,

1 Comment

Darren
Sep 21, 2009 at 4:27 pm

apologies for the delays in my posts, i will be blogging alot more often from now on :)


 

Reply