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

Could not connect to the MariaDB - MySQL database

You will want to verify you are using the correct database name, username and password. All...

PHP information

To view your current version of PHP you will create a php file, for example info.php, and place...

Strict Standards: Non-static method JLoader::register() should not be called statically in...

This error indicates your script is using out-dated PHP commands. It is best to update your...

Error 500 - Internal Server Error - PHP

This can be due to several factors. The first thing to check is that the permissions on the file...

How do I backup a MariaDB - MySQL Database?

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