Knowledgebase: PHP
How can I have the server parse html files as if they were php?
Posted by Arvand Sabetian (Import) on 04 March 2009 01:35 PM
This only applies to linux hosting accounts:

Inside the directory with the html files, create a .htaccess file and inside, place the following -

AddHandler application/x-httpd-php5 .html

For windows hosting accounts:

Inside your web.config file, placed the following between the <handlers> tags:

<add name="html via php cgi" path="*.html" verb="*" modules="FastCgiModule" scriptProcessor="C:\Php5\php-cgi.exe" resourceType="Unspecified" />
(179 vote(s))
Not helpful

Comments (4)
Fred Stetson
22 January 2011 09:27 AM
I am on ASP Personal class and using DNN. I am trying to use existing PHP scripts from Poker Mavens remotely, to show several things, such as; Chip Leader Board, New User Account, and (poker) Server Status. I added the above handler to my web.config file and still nothing. Can anyone help? AM I on the wrong type of server to run DNN?
Arvand Sabetian
31 January 2011 01:32 AM
If you are remotely accessing php files, you do not need any handlers as the php scripts would run on the remote server.
Joe Herzig
20 July 2011 07:31 PM
Any idea how to do this for asp? That is have static .html files run asp by modifying web.config file?
Arvand Sabetian
25 July 2011 09:05 AM
I would use to view your site remotely and under the extensions section, mimic how .asp is setup and alter .html to do the same.
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).