Serve PHP through other file extensions

Views: 12 Last modified: July 31st, 2011 Comments: 0

If you want to serve php code through other files then .php files like php.html or thispage.htm or other extensions, you have 2 different choices what you can do. First you can change the apache configuration file, or you just simply change the .htaccess file (Assuming php is working properly).

We keep it simple and serve php through the .html extension……

Either change the “Main Apache HTTP server configuration file” or the “.htaccess file” by adding (or changing into) the following line:

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

Through this way, you are even free to imagine yourself up a “new” extension like “.new”.

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

In case you change the apache config file, restart apache.

VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)
    Bluehost

    Mail this!

    To: From:Sum {1+3} =  
    Anything to add ?

        You must be logged in to post a comment.