How can I publish PHP code on my .htm and .html pages?
Posted by - NA - on 08 November 2006 08:34 AM

The default setting for most servers do not allow for PHP processing or PHP includes on pages ending in the extensions .htm or .html.

For websites hosted on Apache, a workaround to allow php processing with .htm and .html files is possible by updating the .htaccess file in the root web directory (public_html, www, etc.).

Access your root web folder and find the file called .htaccess. If you are unable to locate this file, it can be created through most administrator control panels in the File Manager area. If you are unable to locate or create the .htaccess file contact your hosting company for instructions.

Edit the .htaccess file to include the following code:

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

Once the changes are saved, php processing should be allowed on all pages of your website ending in the .php, .htm or .html extensions.

(784 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
Full Name:
Help Desk Software by Kayako