Forum Moderators: mack

Message Too Old, No Replies

How to redirect SOME .html pages into PHP

         

kenfused

5:41 pm on Sep 30, 2005 (gmt 0)

10+ Year Member



Hello,

After I started learning some basic PHP, I made all my new pages as PHP pages... so right now I have a mix of .html and .php pages...

I have heard of people using mod-rewrite to have the server treat all .html pages as .php pages...

I'd like to slowly replace my .html pages as .php pages. In the meantime, is there a way I can have the server look for the page as requested, say "home.html" and IF the page exists as a .html page, then go to "home.html" and IF the .html page does NOT exist, then go to "home.php"

Thanks!

mrnoisy

9:54 pm on Oct 2, 2005 (gmt 0)

10+ Year Member



You can run php in files with a .html extension

Paste the following line into your .htaccess file:

AddHandler application/x-httpd-php .html

This way you don't have to change any of your files to .php, and nobody can tell what server-side technology you are using by looking at your file names.

BjarneDM

1:46 pm on Oct 7, 2005 (gmt 0)

10+ Year Member



you might also be interested in looking at the ForceType directive
you can find the documentation here:

Apache 1.3:
[httpd.apache.org...]

Apache 2.0:
[httpd.apache.org...]
[httpd.apache.org...]