Make PHP work in your HTML files with .htacess

By default most web servers across the internet are configured to treat as PHP files only
files that end with .php. In case you need to have your HTML files parsed as PHP (e.g
.html) or even if you want to take it further and make your PHP files look like ASP, you
can do the following:
For web servers using PHP as apache module:
AddType application/x-httpd-php .html .htm
For web servers running PHP as CGI:
AddHandler application/x-httpd-php .html .htm
In case you wish to do the ASP mimick:
For PHP as module:
AddType application/x-httpd-php .asp
OR
For PHP as CGI:
AddHandler application/x-httpd-php .asp
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Can you provide a custom package for me?

Yes, most definitely. Simply open up a helpdesk ticket in the Sales department or contact us...

Redirect URLs using .htaccess

Sometimes you need to redirect some URL and/or page on your site to another one.The feature is...

Force SSL/https using .htaccess and mod_rewrite

Sometimes you may need to make sure that the user is browsing your site over a secure...

Change PHP variables using .htaccess

If you need to change the way your PHP is working you can do that using .htaccess.Please, note...

Block Bad robots, spiders, crawlers and harvesters

There are lots of examples across the internet that use ModRewrite. We will provide such an...