Parsing PHP in .htm/.html files

To have our servers parse PHP code in your .html and .htm pages you will need to modify the .htaccess file in your public_html folder adding the following lines:

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


This can be accomplished by modifying the public_html/.htaccess file manually or this can also be done via the MIME Types icon in your Control Panel.

- Login to your Control Panel
- Click on the MIME Types icon
- In the "MIME Type" field type or paste this:

application/x-httpd-php

- In the "Extension(s)" field type the extension
you wish to have parse PHP code (ex: .html) - Click the Add button

You should now see "application/x-httpd-php .html" listed under "User defined MIME types". If you wish to add other extensions repeat the process above for each extension.

這篇文章有幫助嗎?

 列印本文

Also Read

Troubleshooting

Receiving a "cannot connect to the database" error (particularly if you are a...

Creating MySQL databases

To create a MySQL database: - Go to MySQL Manager in your Control Panel - After DB: type...

What is phpMyAdmin and how do I access it?

phpMyAdmin is a PHP-based MySQL database administration utility which can be used to modify...