0

I actually want to redirect my old website url to new website url.

I have made 1 redirect working properly

for example

http://www.abc-old.com/test to http://www.abc-new.com/test123

but problem is while i have multiple slug or parameters it won't work for me

like

i want to redirect

http://www.abc-old.com/test1/test2 to http://www.abc-new.com/test1

but it is redirecting like

 http://www.abc-old.com/test1/test2 to http://www.abc-new.com/test1/test2

below is my code for same

Redirect 301 /test1/test2 http://www.abc-new.com/test1

Please help me to sort out this

3 Answers 3

1

If your .htaccess file looks like / or the httpd.conf contains this it should work.

Options +FollowSymLinks
RewriteEngine on
Redirect 301 /test1/test2 http://www.abc-new.com/test1

Maybe this could be interesting.

http://www.internetmarketingninjas.com/blog/search-engine-optimization/301-redirects/

Sign up to request clarification or add additional context in comments.

1 Comment

not working Options +FollowSymLinks RewriteEngine on Redirect 301 /kaffemaskiner/office-coffee coffee-break-new.no/kaffemaskiner
0

You can use this rule in old host's root .htaccess:

RedirectMatch 301 "/test1/test2(/.*)?$ http://www.abc-new.com/test1$1

2 Comments

These type of comments never help. What URL did you try? Did it cause 404? Are there existing rules? If yes post them in question.
Glad to know it worked, can you mark the answer as accepted by clicking on tick mark on top-left of my answer.
0

Hie Some how i solved it but still confuse why this thing happned ?

for example I have 3 URL

http://www.old.com/test1/
http://www.old.com/test1/test2
http://www.old.com/test1/test2/test3

I have created 301 redirects in .htaccess like

Redirect 301 /test1/ http://www.new.com/test1
Redirect 301 /test1/test2/ http://www.new.com/test2
Redirect 301 /test1/test2/test3 http://www.new.com/test3

in this case

while i was requesting

http://www.old.com/test1/ is redirected to http://www.new.com/test1

while

http://www.old.com/test1/test2 is redirected to http://www.new.com/test1/test2/

in this case while server execute .htaccess , instead of my second url redirection first was working and additional parameter passing test2 so it new redirect was http://www.new.com/test1/test2

I have write code like this

Redirect 301 /test1/test2/test3 http://www.new.com/test3
Redirect 301 /test1/test2/ http://www.new.com/test2
Redirect 301 /test1/ http://www.new.com/test1

and it started working. i really don't understand why my first code is not working, I have used wordpress CMS , is there any cofiguration required ?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.