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
  • 521 Users Found This Useful

Was this answer helpful?

Related Articles

How do I backup a MariaDB - MySQL Database?

In the control panel, within Backup section, under Download a SQL Database Backup will be your...

InnoDB: Error: Attempted to open a previously opened tablespace. Previous tablespace

When receiving the error     "InnoDB: Error: Attempted to open a previously opened tablespace....

phpMyAdmin - Error Incorrect format parameter

When importing a database with PHPMyAdmin I receive the error "Error Incorrect format parameter"....

How do I change my PHP settings?

How do I change my PHP / PHP.INI settings?To change your PHP settings, just login to your hosting...

How do I add a user to a MariaDB & MySQL database?

In the MariaDB / MySQL Database section of your hosting control panel, after creating a database...