Forum Moderators: phranque

Message Too Old, No Replies

Rewrite html to php

         

grandpa

2:39 am on Feb 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've been dreaming for 2 months about getting my long drop down lists to load from a database. Today is the Big Day!

I have a php page that now takes the place of several html pages. My rewrite is to display the php page and still show the html page (and PR) in the browser address bar.

Here's what I did:

RewriteRule ^page.html$ h**p://www.mydomain.com/page.php [L]

This works, no question about that. page.html appears in the browser address, page.php is being displayed.

Is there anything I've overlooked? I see a potential problem with page.html and page.php containing duplicate content - to some extent.

Will page.php get spidered? It's a combination of html and contains calls to my db on demand.

Anything else I ought to be considering?

jdMorgan

2:59 am on Feb 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As long as you don't ever link to the .php file, it will not exist as far as the rest of the world is concerned, thus no dup-content issue. It is simply the file that your server serves when the .html URL is requested.

This is one of the epiphanies of mod_rewrite -- It makes clear the distinction between a URL and a filename, and illustrates the fact that they need not have anything to do with each other. "Connecting" URLs to filenames is the server's job, and it is not necessarily a straighforward thing.


RewriteRule ^page\.html$ /page.php [L]

Jim

grandpa

3:27 am on Feb 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Got all excited and forgot to escape the .

Thanks Jim