How can I parse .html as .php?

Create an .htaccess file and upload it to the root of your public_html directory. Include the following lines...

 

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



Because these extensions will be processed as PHP with the above command, changing the permission on those file types to 755 may be necessary.

If the above line does not work use the following:


AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml .html .htm


or

 

AddType application/x-httpd-php .php5 .php4 .php .php3 .php2 .phtml .html .htm


If using CloudLinux lsapi /LiteSpeed API, use the following:

AddType application/x-httpd-lsphp .php5 .php4 .php .php3 .php2 .phtml .html .htm
AddHandler application/x-httpd-lsphp .php5 .php4 .php .php3 .php2 .phtml .html .htm

Share this page:


Was this article useful? Have any suggestions or improvements to the information?

Also Read

Increase PHP Memory

Fatal error: Allowed memory size of xxxxxxxxx bytes exhausted (tried to allocate 1064256 bytes)....

Useful CSV to MySQL Script

Provided below is a great tool we have run into for converting CSV files into MySQL format: CSV...

HTTP Authentication error in PHP

Issues with HTTP Authentication error in PHP. Variables $_SERVER['PHP_AUTH_USER'] and...

How to Disable XCache for a Domain

On many of our servers xcache is use as part of the php caching mechanism. If you are...

How can I run PHP5?

PHP5 is now the default PHP ran on our servers. Nothing further is required.