How to treat html file as php file?

by Sanju 2009-03-30 14:53:55

Treat html file as php file

To make your .php file to appear as .html on a browser, you will need to change either the http.conf settings of your Apache Server or create/update your .htaccess file if you don’t have access to the Apache Server configuration file.

Here is how to update your httpd.conf:

AddType application/x-httpd-php .php .html


Notice the ‘.html’ added in the line. This means the server will see .html files as .php.

If you don’t have access to httpd.conf, make the changes in .htaccess by adding this line of code:

AddType application/x-httpd-php .php .html


Make use you save it as .htaccess (notice the ‘.’ before .htaccess) and must be located on the folder where your pages are.

Tagged in:

1473
like
0
dislike
0
mail
flag

You must LOGIN to add comments