Notice:

We've recently performed some software upgrades to both cPanel and the Client Area that has resulted in some of the KB articles appearing outdated and obsolete. We are working to update and/or remove the affected articles but this may take some time. We appreciate your patience!

How to use php in an HTML file

Notice!

We do not recommend the method described below. This article is intended to solve a problem that some customers face after migrating to us.

Some developers have chosen to use .html file extensions for php scripts. The reasoning is unclear but this makes sites a little bit harder to transfer when the receiving server doesn't support that configuration. If your site uses .html files with embedded php code, please add this to your .htaccess file to ensure the pages load properly.

/home/user/public_html/.htaccess

AddType application/x-httpd-php5 .html .htm