Forum Moderators: phranque

Message Too Old, No Replies

Redirect Old to New Urls

         

kory27

9:29 pm on May 12, 2015 (gmt 0)

10+ Year Member



Hi,

I am new enough, as in I've done this several times before, but also confirming I'm taking the right route in redirecting our site migration of over 10,000 urls! Basically, I feel good about how to structure the redirect, but wonder about server load and if I am simply doing this the best way. Here are some examples of my url structure for category and products:

Category Old Category New
http://www.example.com/c-3376-sailing-clothing-apparel.aspx http://www.example.com//sailing-clothing-apparel.html
http://www.example.com/c-307-cam-cleats-accessories.aspx http://www.example.com/hardware/cam-cleats-accessories.html

The first is a parent/root category, the 2nd is a child/2nd level category

Product Old
http://www.example.com/p-33476-musto-hpx-ocean-gore-tex-jacket.aspx

Product New
http://www.example.com/sailing-clothing-apparel/foul-weather-gear-rain-jackets/ocean/musto-hpx-ocean-gore-tex-jacket.html

I am planning on using the standard redirect as I did maintain the same category ID's in both systems. The products I can map from using the SKUs, which were maintained in both systems, but I'll have to use that to get the p number in the old product url. A little work, but not too bad.

The redirect format I am referring is:

RewriteRule ^old-url\.htm$ http://www.example.com/new-url.htm [NC,R=301,L]

Am I taking the correct track? Will this slow my server too much? Lastly, if no to either one, could you kindly provide a better solution/example or point me in the right direction?

Thanks so much!

[edited by: phranque at 10:17 am (utc) on May 13, 2015]
[edit reason] exemplified domains [/edit]

phranque

10:23 am on May 13, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, kory27!


are you sure you need the [NC] flag?

you might consider internally rewriting requests for those urls to a script which uses a lookup table or database and provides the appropriate 301 response.

kory27

2:49 pm on May 13, 2015 (gmt 0)

10+ Year Member



Thank you for the response. Now, that would definitely be out of my wheelhouse, but I can research it and see if I can do it properly.

Any direction is appreciated.

Thanks again.

not2easy

3:23 pm on May 13, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The [NC] flag tells the server that the rule is not "case sensitive" so it needs to watch for any character case and check for /OLd-url.hTm and /oLd-uRl.htM and all other variations to apply the rule, so if you already know that the case is all lower case, you can save the server some time and work. Unless you know that there will be requests in upper and lower case URLs you can make it more efficient by changing to [R=301,L]