saving new page as .html instead of .php

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
You have to create a "fake extension". I suggest you use a framework like codeigniter that has this method built in. But if you wish to build one yourself - study how they do it.
 
You can modify the ending that is shown in the URL using your .htaccess file using rewrites like so:

Code:
RewriteEngine On
RewriteRule ^([A-Za-z0-9]+).php$ $1.htm

This will run .php extensions in your browser as if they were .htm. You can also use your .htm or .html files as PHP files (without URL manipulation) like this:

Code:
AddType application/x-httpd-php .html .htm
.

More on the above method: http://www.besthostratings.com/articles/php-in-html-files.html
 
Back
Top