Forum Moderators: phranque

Message Too Old, No Replies

A Complex Rewrite

         

berrywoods

11:11 pm on May 21, 2010 (gmt 0)

10+ Year Member



Hi Guys

We have had to change e-com software and we have lots pritty much all of our 600 odd google indexed links, im not bad with htaccess and have got the new site producing nice seo friendly urls but id really appreciate a hand getting all my old pages perminantly redirected

thats if its even possible..

Heres one of the old URLs which is indexed

[berrywoods.co.uk...]

this is how they appear now

[berrywoods.co.uk...]

now im guess losing the code at the end of the old one isnt hard, nor is changing underscores to dashes but the fact it now adds a product id number p-53 means its probably impossible without doing them all manually?

jdMorgan

7:10 pm on May 22, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The usual "least painful" solution in this case is to redirect all requests for URLs matching the old format to your script (or to a script) that can look up the new product entries in your database using the old URL (or part of it) of the key.

This is the only way to "associate" the URL-path-part string "p-53" with the product-string "whiskas-pouch-meaty-chicken" -- As you surmise, mod_rewrite cannot make that association unless you manually redirect each old URL request to the new URL.

So, the only dependency with this approach is that your database be sufficiently flexible to allow you to add the "old URL" entries to it -- or at least the old URL entries for your most-popular/best-converting/highest-margin/best-ranked pages... as you deem most important.

A bit of consideration on the current situation will lead to the conclusion that it might be a good idea to implement this database-expansion format in a way that will allow several 'old URL' entries for each new URL... Having learned the lesson once, it's less likely that you you'll ever allow your URLs to change again, but it's certainly not impossible...

Since you're apparently still in the process here, also consider dumping the useless ".html" from the end of all of your new URls -- While filetypes are required on filepaths used within a server, they have no meaning in URLs used "out on the Web" and can be dropped from your "page URLs" -- And better now than later.

Jim