Home > PHP > Can I have all .html pages parsed as PHP?

Can I have all .html pages parsed as PHP?

October 8th, 2009

By default, files ending in .php, .php3, .php4 and .phtml will be parsed as PHP and you do not need to do anything to make this happen.

If you want all .html files parsed as PHP, just add the following line to an .htaccess file in the same directory or any directory above the one in which you want this behavior:

AddHandler cgi-script .html

To also have all .htm files parsed as PHP, add .htm to the end of the above line. Nothing else is required if you want .htm or .html files to be parsed as PHP.

If you want any other filetype other than .htm or .html to be parsed as PHP, such as .wow then you will have to do as above:

AddHandler cgi-script

PHP

  1. No comments yet.
  1. No trackbacks yet.