www.mySite.com verse mySite.com

Discussion in 'Domains, Hosting and Servers' started by The1LT, Oct 31, 2013.

  1. The1LT

    The1LT Regular Member

    Joined:
    Oct 21, 2013
    Messages:
    19
    Likes Received:
    6
    I was reading something the other day about ensuring that you have this set up correctly. Essentially what it said was that if you have it set up incorrectly, the crawlers may identify the content at each location as being separate and drop down your SEO rankings. Also your Google Analytics results could potentially be split between the two addresses

    So my question is, what would be the correct method for ensuring that mySite.com redirects to www.mySite.com correctly.

    If I enter mySite.com into my web browser at present it auto redirects to www.mySite.com. I'm assuming that it's correct but just wanted to check and hear what others have to say.

    Thanks
     
  2. Sylvain

    Sylvain Regular Member

    Joined:
    Mar 15, 2013
    Messages:
    140
    Likes Received:
    17
    You should modify your .htaccess file
     
    The1LT likes this.
  3. Sylvain

    Sylvain Regular Member

    Joined:
    Mar 15, 2013
    Messages:
    140
    Likes Received:
    17
    No matter if you use www or not, stick with the one you chosen first
     
  4. Caddyman

    Caddyman engiwebmastechanic

    Joined:
    Sep 12, 2013
    Messages:
    63
    Likes Received:
    36
    Location:
    Delaware
    Yeah, Google "force www htaccess" and follow the tutorials.

    If your site sites the same content fir www and non www Google could see it as dup content and it can also Jack up analytics and wmt.

    I prefer no www, www is so 2000's lol

    Once you decide, get a Google webmaster tools (wmt) account, register both versions www and no www, then set the preferred domain.
     
    The1LT likes this.
  5. MyDigitalpoint

    MyDigitalpoint Regular Member

    Joined:
    Jun 5, 2013
    Messages:
    114
    Likes Received:
    30
    Location:
    Virtual World
    The choice of www is matter or personal taste, but also depend on the domain name.

    Some domains "look better" with the w's and some others are way too much better without them.

    However, and back with the redirection rule, make sure it's an explicit 301 redirection to avoid duplicate content issues.
     
  6. The1LT

    The1LT Regular Member

    Joined:
    Oct 21, 2013
    Messages:
    19
    Likes Received:
    6
    Cheers guys,

    I eventually figured this out. My site was in fact being counted as two separate sites.

    Here's the steps I followed in case anyone else stumbles across this:

    Easiest way to figure out if you've got it set up correctly is go into Chrome Developer Tools and go to the Network Tab and then refresh the root for each page.

    If the redirection is working correctly the redirected page should be returning a 301 permanent redirect code, where as if it's not as mine was, it returns a 200 response ok.

    I'm using Nginx and so had to make some configuration changes to my Nginx settings file using the information I found here:

    https://www.tinywp.in/301-redirect-wordpress/

    When I go to mySite.com now and check it in the network tab it returns a 301 permanent redirect and automatically changes the url to www.mySite.com.

    If you don't use google chrome there are also some tools on the web to check your url is redirecting correctly - search for "check my http header response codes".
     
  7. Cerberus

    Cerberus Admin Talk Staff

    Joined:
    May 3, 2009
    Messages:
    1,031
    Likes Received:
    500
    You can check the guide in my sig, but seems you found the answer. I will post here for others who may be looking. I myself prefer without www as it is shorter :)

    This is for no WWW:
    Code:
    Code:
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
    RewriteRule ^(.*)$ [URL]http://example.com/$1[/URL] [R=301,L]
    
    
    This is for WWW:
    Code:
    Code:
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^example.com$ [NC]
    RewriteRule ^(.*)$ [URL]http://www.example.com/$1[/URL] [R=301,L]
    
    
     
    The1LT likes this.
  8. MyDigitalpoint

    MyDigitalpoint Regular Member

    Joined:
    Jun 5, 2013
    Messages:
    114
    Likes Received:
    30
    Location:
    Virtual World
    Your SEO 101 guide is really a helpful resource to look. Despite I have been making .htaccess redirections for years, I'm always confused with the rewriting rules to put or remove the w's despite it's so easy as you explain :)
     

Share This Page