Site moved - best practices

Discussion in 'Site & Server Administration' started by Liminal, Aug 4, 2005.

  1. #1
    Hello All,

    One of my URLs has recently changed. I put a small text page under the old url which basically says: our site has moved here... with a link to the new site. The old URL has a non-zero pr which is probably being passed on some to the new site.

    The other approaches I can think of: 1) 301 redirect to the new url and 2) Meta-refresh tag to redirect to the new url

    What do you think of these?

    Thanks,
    James
     
    Liminal, Aug 4, 2005 IP
  2. dct

    dct Finder of cool gadgets

    Messages:
    3,132
    Likes Received:
    328
    Best Answers:
    0
    Trophy Points:
    230
    #2
    301 redirect everytime. Should pass full PR over too.
     
    dct, Aug 4, 2005 IP
  3. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #3
    HTTP redirect is the way to go. Don't use meta-refresh - it is disabled in many Windows installations for security reasons and it is not as standard as HTTP redirect.

    J.D.
     
    J.D., Aug 4, 2005 IP
  4. Liminal

    Liminal Peon

    Messages:
    1,279
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You guys rock! Will do a 301 redirect
     
    Liminal, Aug 4, 2005 IP
  5. Liminal

    Liminal Peon

    Messages:
    1,279
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #5
    So I don't re-invent the wheel or dig around for it, does anyone have a syntax to use in .htaccess?

    Need to redirect example.com to example.org

    Thanks again,
    James
     
    Liminal, Aug 4, 2005 IP
  6. dct

    dct Finder of cool gadgets

    Messages:
    3,132
    Likes Received:
    328
    Best Answers:
    0
    Trophy Points:
    230
    #6
    Taken from Mod rewrite cheat sheet
    
    # Site has permanently moved to new domain
    # domain.com to domain2.com
    RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain2.com/$1 [R=301,L]
    
    Code (markup):
     
    dct, Aug 4, 2005 IP
    Liminal likes this.
  7. Liminal

    Liminal Peon

    Messages:
    1,279
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #7
    dct, thanks man. and thanks for pointing to that resource
     
    Liminal, Aug 4, 2005 IP
  8. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #8
    There's no need to use mod-rewrite for this - too much overhead. Just stick Redirect into your VirtualHost section for the old domain name.

    J.D.
     
    J.D., Aug 4, 2005 IP
  9. Liminal

    Liminal Peon

    Messages:
    1,279
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Good point. Will try that
     
    Liminal, Aug 4, 2005 IP