Duplicate content help, www vs http

Discussion in 'Search Engine Optimization' started by Chewyshoe, Jan 13, 2008.

  1. #1
    Hi guys,

    I know that I need to redirect either the www or http version of my site to the other version.

    How do I go about this?

    (I know it's a stupid question, but I've been neglecting this for ages so I thought I might as well ask.)
     
    Chewyshoe, Jan 13, 2008 IP
  2. dspohn23

    dspohn23 Peon

    Messages:
    370
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if you use Apache, and are able to use mod_rewrite, you can do the redirect using a .htaccess file.

    This example will redirect http://example.com to http://www.example.com , and any subsequent pages as well.

    Create a file at the root of your website named ".htaccess" and place the following contents in it:

    RewriteEngine on

    rewritecond %{http_host} ^example.com [nc]
    rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]
     
    dspohn23, Jan 13, 2008 IP
    Chewyshoe likes this.
  3. Chewyshoe

    Chewyshoe Peon

    Messages:
    401
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Perfect, exactly what I was looking for. Rep added.
     
    Chewyshoe, Jan 14, 2008 IP
  4. Diablos

    Diablos Guest

    Messages:
    563
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can also set a prefered domain in webmaster tools, I recommend you do that too
     
    Diablos, Jan 14, 2008 IP
  5. bogs

    bogs Active Member

    Messages:
    2,142
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    80
    #5
    this might help: webconfs.com/how-to-redirect-a-webpage.php
     
    bogs, Jan 14, 2008 IP