Please Help with WWW Redirect

by PGA
3 replies
Can someone please help with the following?

I had Hostgator set up a www redirect for one of my sites a few months ago. Since then I noticed that my site took a dive and is no longer ranking as it was. Maybe it's coincidence. Anyway, today I just deleted the www redirect so my site is like it was. Since both the www.mysite.com and mysite.com are indexed should I redirect www.mysite.com to mysite.com? I'm just concerned that Google will see it as duplicate content since both are indexed. Any thoughts?

Thanks,
P
#redirect #www
  • Profile picture of the author andrejvasso
    Google will indeed think its duplicated content.

    You should choose wether you want with WWW or without WWW. I personally like to remove the WWW (but thats totaly up to you).

    The code to remove WWW is:

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/ [R=301,L]
    I dont know the code to add WWW, but I am sure a quick Google search will do it.
    {{ DiscussionBoard.errors[3908169].message }}
    • Profile picture of the author ToneUK
      This is the code to redirect none www to www:

      Code:
      RewriteEngine on
      RewriteCond %{HTTP_HOST} !^www. [NC]
      RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
      If you are using Google Webmaster tools you can also tell Google what your preferred domain name is by going to Site configuration > Settings and then selecting either www or none www as the preferred domain.
      Signature
      Free article directory for publishers to download. Free article submission with fast approval times. Submit free articles with back links that are Do follow.
      {{ DiscussionBoard.errors[3938986].message }}
  • Profile picture of the author rohini khanna
    @PGA - same problem here, i m also facing these problems.
    {{ DiscussionBoard.errors[3940832].message }}

Trending Topics