1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Q] Domains | http://SITE.com | http://www.SITE.com

Discussion in 'Black Hat SEO' started by Siek, Nov 18, 2008.

  1. Siek

    Siek Regular Member

    Joined:
    Feb 4, 2008
    Messages:
    456
    Likes Received:
    294
    Hey guys,

    I need some help on this one. I could probably search it up on google and find my answer really fast, but I'm not sure what keywords to use to even look up something like this...

    So bascially I want

    http://SITE.com

    to be redirected as automatically

    http://www.SITE.com

    ---------
    Any help appreciated..

    Thanks
     
  2. WickednDivine

    WickednDivine Executive VIP Premium Member

    Joined:
    Jul 29, 2008
    Messages:
    468
    Likes Received:
    344
    Could do it with either htaccess or a 301 redirect. they should have approximately the same effect.

    here's a couple links i found on google in about 4 seconds

    Code:
    http://fplanque.com/dev/http-ssl/www-domain-canonical-urls-mod_rewrite
    http://www.stepforth.com/faq/non-www-redirect.htm
    
     
    • Thanks Thanks x 1
  3. zensiq

    zensiq Junior Member

    Joined:
    Jun 14, 2008
    Messages:
    171
    Likes Received:
    27
    Redirect to www (htaccess redirect)

    Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
    The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

    Please REPLACE domain.com and www.newdomain.com with your actual domain name.

    Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

    Taken from
    Code:
    http://www.webconfs.com
     
    • Thanks Thanks x 1
  4. snowwhite

    snowwhite Power Member

    Joined:
    Feb 12, 2008
    Messages:
    730
    Likes Received:
    1,415
    Occupation:
    Psychiatrist
    Location:
    Las Islas Filipinas
    301 redirect using .htaccess (does not work if you're on a windows server)
    upload .htaccess files in ascii mode, sending it up as binary will break it

     
    • Thanks Thanks x 1
  5. Siek

    Siek Regular Member

    Joined:
    Feb 4, 2008
    Messages:
    456
    Likes Received:
    294
    damn that was quick guys... Good stuff - exactly what i needed =)