I'm new to all this rewrite stuff, so am looking for some advise on the following: RewriteEngine On #listing_browse RewriteRule ^listing_browse.html listing_browse_test.php This is an extract of what I'm doing which will make my php database pages into html. My query is: When a users types in w w w.mydomain/listing_browse_test.php this .php file appears SHOULDN'T it be the .html ??? Or am I barking up the wrong tree? Ian
If I understand your question correctly, no. Think of it like this: RewriteRule alternate.url real.url Code (markup): The real url (search engine unfriendly one) will always work. The re-written URL (search engine friendly one) is given as an alternative. So you are telling the webserver "if someone asks for alternate.url I know it doesn't actually exist in the file system so give them real.url instead and let them think that alternate.url actually exists".
Thanks for that, I understand what you are saying. So for all my database pages where my .php?$12 will become -12.html people will still be able to go to the .php?$12 page but the BOTS will crawl and start indexing the -12.html so any updates by the SE will result in the -12.html being shown and the .php?$12 will drop out over time. Ian
The bots will only see the .html version by following a link to a page with that extension. For your OpenRealty site you might consider the "site map" mod which dynamically generates a list of static links with the .html extension. Here is an example.
Yes, so long as there are no more links to the old urls. You might also want to put redirects on the old urls to the new urls so SEs don't think they are just a bunch of duplicate pages with different URLs.... I made that mistake once.
Thanks all, yes I think it was the comment that tflifht made about old urls still being around. BUT How would you implement a redirect when you all ready have a re-write on that page? Ian
RewriteRule ^old.url$ new.url [R=301,L] RewriteRule alternate.url real.url Code (markup): If I remember right that is how I did it.
I'm a little (WELL A LOT) confused: This is a link from msn w w w . costay sierra.com /listingview.php?listingID=55 This page is NOW: w w w . costay sierra.com /propiedades-en-venta-55.html AND /listing_browse.php IS NOW /ventas.html This is my htaccess file #listingview RewriteRule ^propiedades-en-venta-([0-9]*).html listingview.php?listingID=$1 RewriteRule ^propiedades-en-venta.html listingview.php #listing_browse RewriteRule ^ventas.html listing_browse.php RewriteRule ^ventas_page-([0-9]*).html listing_browse.php?cur_page=$1& RewriteRule ^ventas.html listing_browse.php?sortby=price&sorttype=DESC& #viewimage RewriteRule ^viewimage.html viewimage.php RewriteRule ^viewlistingimage-([0-9]*).html viewimage.php?imageID=$1&type=listing Code (markup): You can still go to the listingview.php?listingID=55 so where do I put the [301,L] that you mentioned!!! Ian
RewriteRule ^propiedades-en-venta-([0-9]*).html listingview.php?listingID=$1 [R=301,L] If I understand correctly.
Thanks for all your help Tim. One final Q. Does this mean that after X amount of time I can change the .php files mentioned above to .html and add the appropiate the following code to make html act as php. AddType application/x-httpd-php .php .htm .html i.e. listingview.php to propiedades-en-venta- This is now my htaccess file: #listingview RewriteRule ^propiedades-en-venta-([0-9]*).html listingview.php?listingID=$1 [R=301,L] RewriteRule ^propiedades-en-venta.html listingview.php [R=301,L] #listing_browse RewriteRule ^ventas.html listing_browse.php [R=301,L] RewriteRule ^ventas_page-([0-9]*).html listing_browse.php?cur_page=$1& RewriteRule ^ventas.html listing_browse.php?sortby=price&sorttype=DESC& #viewimage RewriteRule ^viewimage.html viewimage.php [R=301,L] RewriteRule ^viewlistingimage-([0-9]*).html viewimage.php?imageID=$1&type=listing Code (markup): Ian
OK, just worked out that NO I can't change the files after X amount of time, amazing what a good nights sleep will do! Does the htaccess look fine? Ian
It looks okay to me, but looks can be deceiving. Test the URLs and if they work as planned then there you go!
tflight, you might be able to get much more detailed help on this stuff on the open-realty.org forum.