301 Redirect

Discussion in 'Programming' started by Adnan959, Jun 13, 2011.

  1. #1
    Hey guys,

    Normally when I setup my 301 redirect to redirect my site from sample.com to www.sample.com I use this:
    
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
    
    Code (markup):
    However, for some reason whenever I set this up Google fails to recognize my backlinks and as soon as I remove it they all pop up at the same time.

    Can anyone suggest a GOOGLE FRIENDLY 301 redirect which I can use please?

    Thanks!
     
    Adnan959, Jun 13, 2011 IP
  2. jkl6

    jkl6 Peon

    Messages:
    70
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    jkl6, Jun 14, 2011 IP
  3. Adnan959

    Adnan959 Member

    Messages:
    894
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #3
    Thanks for the reply. I've already done that. But is that enough?
     
    Adnan959, Jun 14, 2011 IP
  4. Openxcell Inc

    Openxcell Inc Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think you did optimization first and then redirection, so you are getting problem. Because if you do like this google has crawled you site first, so the backlinks you got is without www. So just revert this process and then you will get backlinks for your site.
     
    Openxcell Inc, Jun 18, 2011 IP