Welcome to WebmasterWorld Guest from 54.161.92.49

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

301 redirects for re-design

     
5:18 pm on Oct 23, 2011 (gmt 0)

Junior Member

10+ Year Member

joined:June 11, 2007
posts: 45
votes: 0


This is my first time setting up 301 redirects using .htaccess and I want to make sure that I have it right.

I'm re-designing a new site for a particular domain, so I want to re-direct ranking pages from the old/current site to the new re-designed site. The domain stays the same.

Is this the correct code to use in the .htaccess file?
Redirect 301 /old/old_page.html /new/http://www.domain.com/new_page.html

Specifically, do I only include the full url for the new page?

Thank you!
Ron
6:22 pm on Oct 23, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


What you use depends on what the old URLs were and what the equivalent new URL for each one will be.

For best SEO effect, the new site should use the exact same URLs as the old one - unless you're also taking this opportunity to move from URLs with parameters to "searchengine friendly" URLs.

Requests should be redirected from old URL to new URL in a single step. Avoid any and all redirection chains, especially for non-canonical requests.
8:53 pm on Oct 23, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13841
votes: 485


Specifically, do I only include the full url for the new page?

It depends whether you are using mod_alias or mod_rewrite. Here you are in mod_alias (Redirect by that name). It will reappend the rest of the path, if any. So

Redirect 301 /old http://www.example.com/new

(what was the "new" doing at the front of the path?) really means:

take anything containing
/old{blahblah}

and kick it over to
http://www.example.com/new{blahblah}

But if you used the equivalent wording in mod_rewrite

RewriteRule old http://www.example.com/new [R=301,L]

(note missing leading slash) it would mean

take anything containing
/old{blahblah}

and kick it over to
http://www.example.com/new

without attendant blahblah. To achieve the same result as the mod_alias version, you need to capture:

RewriteRule old(.+) http://www.example.com/new$1 [R=301,L]
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members