How to parse PHP in HTML files?

If you want to make all of your website's .html pages to run as .php files instead (parsing PHP in HTML files), all you need to do is add the following line to your .htaccess file:

AddHandler application/x-httpd-lsphp .htm .html

IMPORTANT: Make sure to make backups of your original .htaccess file, as making changes to this file can disrupt access to your website.

  • html, PHP, parse, htaccess
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Is allow_url_fopen enabled on your servers?

PHP function allow_url_fopen is enabled on all of our Shared Hosting packages. 

Do you support GCC compiler?

GCC compilers are not supported on Ultahost.com our servers. You can still install it on our VPS...

PHP Fatal error: Cannot redeclare

If you see error message 'PHP Fatal error: Cannot redeclare function' or similar error message in...

How to turn off PHP error reporting?

To turn off PHP error reporting you can use the following snippet in your PHP script:...

I get 'unexpected T_STRING' error

You may get this error because all .html files are parsed as PHP here. So, if your .html file...