DESIGNED DEVELOPED DELIVERED

Mob: 07760 392284edward@ee-web.co.uk

ee-web thinks... a bit

Go on, make my day ... leave a comment

www and non-www urls

February 2nd, 2012 by Edward

Suppose you have a site with the domain mysite.com. Google will see www.mysite.com and mysite.com as two different sites. This can affect you rankings, although there is (as always) discussion out there about just how much.
Its important to tell goolge which of these is there prefered domain often called the “canonical” domain – personally, I like the www version, so I normally set this via the google developer tools for my sites. Here’s a quote from google themselves:

Once you tell us your preferred domain name, we use that information for all future crawls of your site and indexing refreshes. For instance, if you specify your preferred domain as http://www.example.com and we find a link to your site that is formatted as http://example.com, we follow that link as http://www.example.com instead. In addition, we’ll take your preference into account when displaying the URLs.

Also, as a belt and braces thing I often set a 301 re-direct in the .htaccess file. This then means that should anyone follow a link such as http://mysite.com/apples they will be automatically redirected to http://www.mysite.com/apples – and this is what will appear in the browser window.

You can set the .htaccess file like this

Options +FollowSymLinks
RewriteEngine On
#to send mysite.com -> www.mysite.com
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=permanent,L]

There’s lots of good info out there on how to edit the .htaccess file – try

categories

Edward owns and runs ee-web design and has been building websites for over 12 years. He is passionate about... most things really

Was this post helpful or interesting? Spread the news.

  1. Most people know that one can link one’s site with www or non www versions. This simply means that when one tries to open a site with http://www.Mycompany.com or http://Mycompany.com, both will open up your site.

    Comment by seo uk — February 3, 2012 @ 7:20 am

  2. Please do more because I really enjoyed reading your article on this.
    codes are exelent

    Comment by طراحی سایت — February 3, 2012 @ 5:48 pm

  3. Thanks both for your comments – you are right to say that either http://www.domain or domain will get you to your website. But it is important to tell google that they are both the same site! Personally, I think the re-direct is a good idea too – apart from anything else it keeps things neat and tidy

    Comment by Edward — February 3, 2012 @ 10:26 pm

  4. THANKS FOR YOUR ARTICLE

    Comment by تامبلر — March 30, 2016 @ 8:25 am

Leave a comment

*


tag