Forum Moderators: coopster & phranque

Message Too Old, No Replies

How to do a 301 permanent redirect and what are the effects.

         

RussellC

7:39 pm on Jan 23, 2002 (gmt 0)

10+ Year Member


Im not completely sure how to do this. Our company has changed URL's so I need a redirect, so there is no dupe content on the old site and new site. I have searched the site and found that I can put:

redirect 301 / http://www.newdomain.com/

in my .htaccess file and this will do it. However, will this do it for the entire site? Also can anyone point me to a link that shows what search engines see when you do this?

Thanks

mivox

7:50 pm on Jan 23, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming you're on apache, a permanent redirect (as I'm using it in my .htaccess, with no ill effects in any search engines) would be:

RedirectPermanent / [newurl.com...]

Now, that would send everyone to the front page of your new location. If they had a specific page of the old site bookmarked, it might be somewhat annoying to be sent to the front page of the new location instead.

If the site at the new URL is an exact duplicate of the old one, you might want to put up a page-by-page redirect .htaccess at the old site, so everyone would be sent where they wanted to go...

RedirectPermanent /oldpage1.htm [newurl.com...]
RedirectPermanent /oldpage2.htm [newurl.com...]

Etc., etc.

gethan

8:02 pm on Jan 23, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've done the same thing with mod_rewrite more complex but will allow old bookmarks and links to work ... (which should be hunted down).

also see:
[webmasterworld.com...]
[webmasterworld.com...]


rewriteEngine on
rewriteBase /
rewriteCond %{HTTP_HOST} olddomain.com$ # only required if on same webspace & dir
rewriteRule ^(.+) http://www.newdomain.co.uk/$1 [L,R=301]

If your site doesn't get lots of incoming hits except on the main page, or if the structure has changed use the method suggested by mivox above.

RussellC

8:06 pm on Jan 23, 2002 (gmt 0)

10+ Year Member



Thank you so much!!! This helps alot.

-Russell