How to redirect www links to just domain name?

Discussion in 'Black Hat SEO Tools' started by dgfalk, Aug 17, 2011.

  1. dgfalk

    dgfalk Power Member

    Joined:
    Apr 26, 2010
    Messages:
    687
    Likes Received:
    94
    Awhile ago I participated in a test Linklicious was doin to get sites out of the sandbox. I dunno what they did but now my domain is ranking #32 for http://www.mydomain.com The problem is I build all my backlinks to http://mydomain.com

    Is there any way to redirect those www backlinks? I think I have to do something with an htcaccess but not quite sure.
     
  2. GrizzlyAdams

    GrizzlyAdams Regular Member

    Joined:
    Feb 17, 2011
    Messages:
    478
    Likes Received:
    404
    Occupation:
    Freelancer
    Location:
    British Columbia
    .htaccess for filename

    place in your root

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
    RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
     
  3. dgfalk

    dgfalk Power Member

    Joined:
    Apr 26, 2010
    Messages:
    687
    Likes Received:
    94
    Alright thanks. I added that code you gave me so it looks like this, Does everything look right?

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

    kkvsam Senior Member

    Joined:
    Oct 11, 2009
    Messages:
    942
    Likes Received:
    570
    Occupation:
    SYS ADMIN
    Home Page:
    create CNAME record for www and is pointed to your domain in your DNS.
     
  5. dgfalk

    dgfalk Power Member

    Joined:
    Apr 26, 2010
    Messages:
    687
    Likes Received:
    94
    Say what??
     
  6. proimage

    proimage Registered Member

    Joined:
    Aug 5, 2011
    Messages:
    62
    Likes Received:
    9
    Occupation:
    web developer
    Location:
    Atlanta
    a simple redirect in cpanel works equally well also
     
  7. 7 Zulu

    7 Zulu Newbie

    Joined:
    Jan 14, 2011
    Messages:
    26
    Likes Received:
    6
    Home Page:
    Yes, everyone has a preference as to how to go about this, I find it simplest to modify my htaccess, because that is how I first learned :p

    I hope I am not being redundant, but thought it might be nice to mention the reason that this is important to do.

    When there are two versions of a site, www and non, then google sees that as two different sites, and from an seo perspective, that is very bad. Also, I am not sure, but there might be a duplicate content issue involved with the "two sites" that google sees.

    Interesting note: There are many sites that make this mistake, even ones that purport to be in the seo business :rolleyes: