Scorpioniz
Scorpioniz

Reputation: 1449

301 redirects redirecting not the specified link

want to redirect some links from oldsite to new one and doing like this:

Redirect 301 /benefits  http://newsite.com/our-differiantiators/
Redirect 301 /benefits/our-people http://newsite.com/about-us/
Redirect 301 /benefits/our-places http://newsite.com/infrastucture/
Redirect 301 /benefits/our-platforms    http://newsite.com/infrastucture/
Redirect 301 /benefits/our-experience http://newsite.com/
Redirect 301 /benefits/our-testimonials http://newsite.com/

but if i try to go to my newsite.com/benefits/our-people it redirecting to newsite.com/our-differiantiators/our-people not newsite.com/about-us

how should I fix my .htaccess code to redirect like I want?

P.S. maybe it's because slug /our-people and /our-differiantiators and wordpress somehow is handling that?

Upvotes: 2

Views: 53

Answers (2)

Mohammed Elhag
Mohammed Elhag

Reputation: 4302

change this line :

Redirect 301 /benefits  http://newsite.com/our-differiantiators/

by this :

RedirectMatch  301 /benefits/$  http://newsite.com/our-differiantiators/

With RedirectMatch you will match only benefits/ ,ended with slash, directory when it comes alone otherwise the other rules will work

Upvotes: 4

vpalade
vpalade

Reputation: 1437

Try to write: Redirect 301 /benefits http://newsite.com/our-differiantiators/ at the end of file;

Or you can change the first line with: RedirectMatch ^/benefits$ http://newsite.com/our-differiantiators/

Upvotes: 2

Related Questions