Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

Redirection

Discussion in 'Website Design' started by cc976a, Jan 12, 2012.

Thread Status:
Not open for further replies.
  1. cc976a United Kingdom

    cc976a Well-Known Member

    Joined:
    Jun 2007
    Posts:
    1,908
    Likes Received:
    10
    I'm very slow out of the blocks on this one but want to start redirecting my non www. domain to my www. domain (i.e. mywidgets.co.uk to www.mywidgets.co.uk)....

    ....but what one do you link to the other?

    Is it based on what Google shows in your SERP as being the main - or which one sends most visitors to your site from analytics tools - or is there another way of working this out ??
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
    IWA Meetup
     
  3. js1 United Kingdom

    js1 Retired Member

    Joined:
    Jan 2011
    Posts:
    390
    Likes Received:
    9
    If you want to create one url in the serps (addressing any duplicate pages / canonical issues from the non www.) And also ensure the value from any links going to the non www. Go to your sites home page of http://www.mywidgets.co.uk/ you need to create a 301 redirect.

    First thing I would do is speak to your host and ask them if the server can handle a 301 redirect via a htaccess file (ensuring the RewriteEngine is switch on etc).

    If you site is hosted on a linux server open notepad and create a file called .htaccess the below code should do the trick (replacing the mywidgets.co.uk with your site name).

    Code:
    Options +FollowSymLinks
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^mywidgets\.co.uk [NC]
    RewriteRule (.*) http://www.mywidgets.co.uk/$1 [R=301,L]
    If not try

    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteBase /
    
    RewriteCond %{HTTP_HOST} ^mywidgets\.co.uk [NC]
    RewriteRule (.*) http://www.mywidgets.co.uk/$1 [R=301,L]

    I would test this on a test site on the same server first
    not your main site once the .htaccess file has been added, clear all history in your browser and refresh the page etc.


    If you sites files are built in html your might want to also 301 redirect the index.html pages i.e
    http://www.mywidgets.co.uk/index.html to http://www.mywidgets.co.uk/

    Add the below to the above to 301 redirect all files ending in index.html to /

    Code:
    RewriteCond %{THE_REQUEST} ^.*/index.html
    RewriteRule ^(.*)index.html$ http://www.mywidgets.co.uk/$1 [R=301,L]
    You should also do a http header check to ensure it is redirecting probably (and ensure it is a 301 redirect) as you don’t want to block your site if something is a miss, hence testing on a test site on the same server etc.

    try

    http://www.rexswain.com/httpview.html

    or

    http://web-sniffer.net/
     
    Last edited: Jan 12, 2012
  4. cc976a United Kingdom

    cc976a Well-Known Member

    Joined:
    Jun 2007
    Posts:
    1,908
    Likes Received:
    10
    Many thanks for all this - very much appreciated. Will certainly come in useful

    Anyone any thoughts on which way round to do the redirection (www to non www or vice versa)?
     
  5. js1 United Kingdom

    js1 Retired Member

    Joined:
    Jan 2011
    Posts:
    390
    Likes Received:
    9
    Are there links pointing to the site? if so to which url non www. or the www. ?

    Is the non www. or the www. indexed in google?

    Do you have a google webmaster tools account what does that say? have you set what url you want there? Have added a xml site map there with the correct urls?

    How does you site link to its pages?
     
    Last edited: Jan 12, 2012
  6. cc976a United Kingdom

    cc976a Well-Known Member

    Joined:
    Jun 2007
    Posts:
    1,908
    Likes Received:
    10
    I don't have all the answers as of now but I understand from your questions the relevance should be based on incoming links and Google's ranking URL - treat that as main and redirect the other.

    I imagined this would be the case but wanted to make sure there was nothing crucial I'd missed

    Thanks again mate
     
Thread Status:
Not open for further replies.