May
7
2009

Make PHP to work in your HTML files with .htaccess


By default most web servers across the internet are configured to treat as PHP files only files that end with .php. In case you need to have your HTML files parsed as PHP (e.g .html) or even if you want to take it further and make your PHP files look like ASP, you can do the following:
For web servers using PHP as apache module:

AddType application/x-httpd-php .html .htm

For web servers running PHP as CGI:

AddHandler application/x-httpd-php .html .htm

In case you wish to do the ASP mimick:

For PHP as module:

AddType application/x-httpd-php .asp

OR for PHP as CGI:

AddHandler application/x-httpd-php .asp

Related Posts

About the Author:

Hobbies: Reading books, listening to music, coding, robotics

Leave a comment


Domain Registrations starting at $9.98*

Categories

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

EverBot twitter