Moving to new domain, how do I redirect properly?

Discussion in 'Google' started by zaui, Jul 3, 2007.

  1. #1
    Hi,

    I'm moving to new domain, how do I redirect properly? (I really dont want to have to do it but I have no alternative).

    What is the best way to redirect visitors coming from google's spiders to the new pages. No changes to actual content will be made.

    How can I do this to minimize the damage I will suffer from Google, in diluting my pages or other things?

    Thanks,

    Zaui
     
    zaui, Jul 3, 2007 IP
  2. Pedro Monteiro

    Pedro Monteiro Well-Known Member

    Messages:
    1,261
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    185
    #2
    A 301 permanent redirect is the best solution.
     
    Pedro Monteiro, Jul 3, 2007 IP
  3. Blackmane

    Blackmane Peon

    Messages:
    766
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Why did you have to change?
     
    Blackmane, Jul 3, 2007 IP
  4. Pedro Monteiro

    Pedro Monteiro Well-Known Member

    Messages:
    1,261
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    185
    #4
    
    <?
    Header( "HTTP/1.1 301 Moved Permanently" ); 
    Header( "Location: http://www.yoursite.com" ); 
    ?> 
    
    PHP:
     
    Pedro Monteiro, Jul 3, 2007 IP
  5. zaui

    zaui Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the HowTo tip Pedro. =) Fast response too going to make that implementation today!


    As for why I have to do it lets just say google doesn't like my old domain name and contacted me about it ;p No black hat stuff just in the grey zone.

    Zaui
     
    zaui, Jul 4, 2007 IP
  6. mak445

    mak445 Banned

    Messages:
    185
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    google email you about it ?
     
    mak445, Jul 4, 2007 IP
  7. netidme

    netidme Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    What is the difference between a 301 and a 302 redirect? I'm new to seo, and have heard both mentioned but dont know the difference.
     
    netidme, Jul 4, 2007 IP
  8. Chris Grant

    Chris Grant Peon

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Chris Grant, Jul 4, 2007 IP
  9. netidme

    netidme Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks Chris,
    Had a quick skim read, seems quite technical to me, tho I'm blaming my confusion on being new to all this - I'll hopefully be able to digest it properly later. thanks
     
    netidme, Jul 4, 2007 IP
  10. Chris Grant

    Chris Grant Peon

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    The difference between them is that a 301 redirect means that a page has permanently moved to a new location, while a 302 redirect means that a page has temporarily moved to a new location.
     
    Chris Grant, Jul 4, 2007 IP
  11. netidme

    netidme Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Ah, I understand now - thanks!
     
    netidme, Jul 4, 2007 IP
  12. zaui

    zaui Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Hi,

    I've tried redirecting my site (blog) however using PHP i receive this:

    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: ".$newlocation );
    exit();

    200 OK

    Site has moved here. (which does show the correct link) however people still need to click it. I would like this to be automatic and redirect without user involvement.

    Next I started trying .htaccess redirection..

    I have the pretty urls enabled. So the following redirects every pages to the home page of the new blog (which sucks!) I'd like to redirect them to their corresponding posts ie.

    http://oldblog.com/oldpage/ -> http://newblog.com/newpage/

    but what happens with the script below is:

    http://oldblog.com/oldpage/ -> http://newblog.com/index.php


    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteRule (.*) http://newblog.com/$1 [R=301,L]
    </IfModule>

    # END WordPress


    any suggestions?

    Thanks,

    Zaui
     
    zaui, Jul 6, 2007 IP
  13. zaui

    zaui Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I've got a redirect to work but its ugly, ideas on how to beautify it would be most welcome =) Note that I removed the [L] after index that got it to start redirecting.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php
    RewriteRule ^(.*)$ http://www.newblog.com$1 [R=301,L]
    </IfModule>

    # END WordPress




    HERE's THE PROBLEM:

    http://www.oldblog.com/category/sports/

    Redirects as ->

    http://www.newblog.com/index.php/sports/


    My new urls now show an "index.php" in the address bar how do I get it to say : http://www.newblog.com/category/sports/


    Thanks,

    Zaui
     
    zaui, Jul 6, 2007 IP
  14. jmort732

    jmort732 Peon

    Messages:
    543
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Zaui,
    That is a rewrite not a redirect (at least I think).

    Assuming you are on a unix based platform, I have always done it this way in the .htaccess file (you don't need anything before or after, just the line).

    Redirect 301 /oldpage/ http://newblog.com/index.php

    If you want to make sure that each pages' PR is passed, then you will have to do a redirect for each page. So for example

    Redirect 301 /oldpage1.html http://newblog.com/oldpage1.html

    The PR won't show up in the toolbar for a couple of months (depending obviously on the snapshot, and export timing, it could take up to 6 months ) but the juice will still pass.

    Morty
     
    jmort732, Jul 6, 2007 IP
  15. shanaka

    shanaka Active Member

    Messages:
    409
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    81
    #15
    good information zaui
     
    shanaka, Jul 6, 2007 IP
  16. zaui

    zaui Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Hi jmort732 ,

    Well said, however I have over 1000 html files and I'd like to do a redirect them en masse.

    Thanks,

    zaui
     
    zaui, Jul 6, 2007 IP
  17. jmort732

    jmort732 Peon

    Messages:
    543
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    0
    #17
    I know the pain all too well :)

    It really depends on how bad you want to keep your PR. You may just want to cherry pick pages and do it that way.

    For one massive move, I used Xenu link sleuth to crawl the current site, then copy and pasted the URLs into a spreadsheet (twice), and did some file and replace stuff to format it all. If the format change is consistent, you may be able to do something along these lines.

    Good luck!
    Morty
     
    jmort732, Jul 6, 2007 IP