Forum Moderators: phranque

Message Too Old, No Replies

Redirect from Old to New blog

         

Buster13

8:55 am on Jan 26, 2010 (gmt 0)

10+ Year Member



I know this is simple but I just couldn't figure it out.

I have old blog

[abc...]

and I want to redirect all requests* to

new blog

[abc...]

What is the redirect I need to add to my htaccess?
---------
*
[abc...]
[abc...]

(anything ANY requests to /news-blog/(anything here) just redirect to HOMEPAGE of new blog)

jdMorgan

4:05 pm on Jan 26, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What have you tried so far?

(Please see our Forum Charter [webmasterworld.com] if the reason for this question isn't clear.)

Thanks,
Jim

Buster13

4:30 pm on Jan 28, 2010 (gmt 0)

10+ Year Member



# Redirect Wordpress folder from /old-blog/ to /new-blog/
# Also redirect ANYTHING from old-blog requests
# eg. old-blog/?p=2 OR old-blog/?m=20091201

RewriteRule ^old-blog(.*)$ http://www.example.com/new-blog/ [L,R=301]

-----
its works but hit 302 one time under google search when u click the old-blog/(link) before going to 301.

[edited by: jdMorgan at 5:33 am (utc) on Jan. 29, 2010]
[edit reason] example.com [/edit]

Buster13

12:43 am on Jan 29, 2010 (gmt 0)

10+ Year Member



is there a more 'efficient' way for my above 301 rules?

jdMorgan

5:04 am on Jan 29, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




RewriteRule ^old-blog/(.*)$ http://www.example.com/new-blog/$1 [R=301,L]
-or-
RewriteRule ^old-blog/ http://www.example.com/new-blog/ [R=301,L]
-or-
RewriteRule ^old-blog/(.*)$ http://www.example.com/new-blog/$1? [R=301,L]
-or-
RewriteRule ^old-blog/ http://www.example.com/new-blog/? [R=301,L]

The first rule keeps the old URL-path and query string that follow "/old-blog/"
The second rule discards the old URL-path, but keeps the old query string.
The third rule keeps the old URL-path, but discards the old query string.
The fourth rule discards both the old URL-path and the old query string.

Jim