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 can I view/modify data in my MariaDB - MySQL database?

Only make changes if you know exactly what you are doing. Often incorrect changes can have an...

The MySQL server is currently offline. admin bin Cpanel/cpmysql/DBCACHE: exit 11

# This error shows in all user control panels via the "MySQL Databases" icon...   The MySQL...

What is the proper MariaDB - MySQL import and export format?

The easiest way to import and export a database is via the backup section of our hosting control...

403 Forbidden error with Drupal after install.

Remove the following lines from the .htaccess file... Options -Indexes Options FollowSymLinks...

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