Forum Moderators: phranque

Message Too Old, No Replies

writting a mod rewrite

writting a mod_rewrite help..

         

adrianbromfield

2:10 pm on Sep 4, 2007 (gmt 0)

10+ Year Member



hi guys,

im wondering if someone can help me, i have been looking into using this mod rewrite stuff however the things i have looked at have actually on confused me, some reason i just cannot seem to make sense of it.

i am looking to have my urls change from..
www.web.com/properties.php?propertytype=value
to..
www.web.com/properties/propertytype/value
am i right in thinking this is how it should work? also can anybody show me how i would go about doing this and maybe explain the parts in 'dummies' language to me.

thanks for any help..

adrian

g1smd

2:22 pm on Sep 4, 2007 (gmt 0)

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



The URLs that the user sees are simply those that appear in the links in your pages, so you will need to change all of the links on all of the pages to look like folder-based URLs.

Next, you use ModRewrite to translate a folder-based URL request into the parameter-based filepath on the server to fetch that content from. There are many previous examples here that show exactly how to do this.

Finally, you will need to set up a redirect so that if anyone requests a parameter-based URL, they will be redirected to the equivalent folder-based URL, so preventing duplicate content.

This thread shows just such a redirect and rewrite (with some canonicalisation stuff in the middle): [webmasterworld.com...] however it isn't for parameter-based URLs in that case.

g1smd

3:04 pm on Sep 4, 2007 (gmt 0)

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



Looks like [webmasterworld.com...] is going to run in parallel.

adrianbromfield

8:37 am on Sep 5, 2007 (gmt 0)

10+ Year Member



thanks for responses, think im getting it now,
just now for the test run i guess :)

g1smd

1:20 pm on Sep 5, 2007 (gmt 0)

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



Check very carefully what you are doing as you go along. You need to make sure that every URL type on your site returns the correct response: "301 Moved" with a new URL to visit, or "200 OK" with content. Use "Live HTTP headers", or similar, for that.

Especially run Xenu LinkSleuth over your site and check both the progress list and the final report very carefully for any sort of anomolies.