Make .php code read as .html, easy .htaccess change!

Updated 2 years ago 646 views

Say you want to use a PHP include inside one of your pages, but they all have a .html extension. If you don't want to convert your page to a .php extension, just add this one simple line of code to your .htaccess file.

 

<table><tbody><tr><td><strong>CODE</strong></td></tr><tr><td>AddType application/x-httpd-php .php .html</td></tr></tbody></table>

This will treat all the code in your pages as PHP before it displays it on the page.

Still need help?

If this article did not answer your question, our support team can help.

Contact support
Top