Domain Adress Question

Discussion in 'Site & Server Administration' started by chlopzmazur, Feb 19, 2009.

  1. #1
    Hello,

    I made a site (forum) and it works in both adresses: http://xyz.com and http://www.xyz.com . I prefer to work it with www . Unfortunetly Google seems to like indexing my site without www. Is there any way to set the way Google index site with www or without? Maybe some server settings? Please help.

    Thanks in advance
     
    chlopzmazur, Feb 19, 2009 IP
  2. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #2
    The way I would do it is to put the following in .htaccess, changing the domain name as appropriate:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^forums\.tolranet\.com [NC]
    RewriteRule (.*) http://forums.tolranet.com/$1 [R=301,L]
    Code (markup):
    That will then always force users and bots to your chosen form, so in the above if someone enters www.forums.tolranet.com then it redirects them to forums.tolranet.com.

    If you're on a Windows host then the above will not work, you can specify the www or non-www version in the google webmaster tools www.google.com/webmasters/tools/ but I've no idea how well that works.
     
    tolra, Feb 19, 2009 IP
    Camay123 likes this.
  3. starangel

    starangel Notable Member

    Messages:
    164
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    208
    #3
    Domain redirect for www is another way.
     
    starangel, Feb 19, 2009 IP
  4. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #4
    tolra response is good. It also works great with google webmaster tools.

    +rep
     
    Camay123, Feb 19, 2009 IP