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



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

When trying to connect to MariaDB or MySQL you receive error 2003 Cannot connect to MySQL on x.x.x.x on port 3306 (10060)

Please ensure you have added the remote IP to the allow list in your hosting control panel...

I am having problems with a script I wrote.

PHP suexec is running on all of our shared servers. If you are running code that is insecure or...

How can I find my MariaDB - MySQL version?

Login to cPanel In the "Stats" section on the left, locate the row labeled "MariaDB or MySQL...

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...

Running a PHP file with a cron job

To run a PHP file from cron, use the "cron jobs" section of your control panel. Use the following...