0

I'm trying to redirect

http://www.example.com/shop/childrens-shinnerz-by-size/extra-small

to

http://www.example.com/sports-goods/childrens-shinnerz/all-extra-small-5-7-yrs

with that way

Redirect 301 /shop/childrens-shinnerz-by-size/extra-small /sports-goods/childrens-shinnerz/all-extra-small-5-7-yrs

But it is redirecting on wrong url

http://www.example.com/sports-goods/childrens-shinnerz/extra-small

So parts all- and -5-7-yrsare ignored.

How can I redirect to the correct URL?

cadaniluk
  • 15,027
  • 2
  • 39
  • 67
Max Leps
  • 469
  • 3
  • 12

4 Answers4

0

Use this , it should work:

     RedirectMatch 301 http://www.example.com/shop/childrens-shinnerz-by-size/extra-small(.*) http://www.example.com/sports-goods/childrens-shinnerz/all-extra-small-5-7-yrs/$1

Source: http://www.htaccessredirect.net/

SG_Rowin
  • 622
  • 3
  • 19
0

If you are using the .htaccess file in the root of your site,

  RewriteRule ^shop/childrens-shinnerz-by-size/extra-small(.*)$ http://www.example.com/sports-goods/childrens-shinnerz/all-extra-small-5-7-yrs/$1 [R=301,NC,L]
Roger Creasy
  • 1,419
  • 2
  • 19
  • 35
0

I find a way

RedirectMatch 301 ^/shop/childrens-shinnerz-by-size/extra-small$ /sports-goods/childrens-shinnerz/all-extra-small-5-7-yrs

this is working as I wanted

Max Leps
  • 469
  • 3
  • 12
-1

i have tested it on my server and it works fine
http://www.familybmi.com/shop/childrens-shinnerz-by-size/extra-small
maybe there's something wrong with your apache try to test something else like

Redirect 301 /retiredpage.html http://www.example.com/newpage.html

and play a little with that if you don't get the desired results to it means you need maybe to update your apache