Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have checked my website using this SEO tool and the results report 2 issues:

Test your site for potential URL canonicalization issues. Canonicalization describes how a site can use slightly different URLs for the same page - for example: if www.mydomain.com and http://mydomain.com displays to the same page but do not resolve to the same URL. If this happens, search engines may be unsure as to which URL is the correct one to index. Learn more about canonicalization issues.

  1. www.mydomain.com and mydomain.com should resolve to the same URL, but currently do not.

  2. Your site's IP xxx.xxx.xx.xxx does not redirect to your site's domain name. This could cause duplicate content problems if a search engine indexes your site under both its IP and domain name. Consider using a 301 re-write rule in your .htaccess file so that your site's IP points to your domain name. Read more about canonical URL issues.

How can I configure my website to solve the 2 issues above? My website uses a Window server (ASP.net). I want to optimize for SEO, but first I must solve this.

share|improve this question
    
Can you currently use www.mydomain.com to access your site? ie. Are the appropriate DNS records already in place for this work? –  w3d Dec 19 '13 at 17:06
1  
Thanks for reply @w3d ! Config by using DNS is good but the SEO Tools, special is like Statscrop.com can't understand www.mydomain.com and mydomain.com is one, it still warning on rule of SEO and SEO will lose points. My case is so.. –  xmencute Dec 20 '13 at 16:44

1 Answer 1

up vote 2 down vote accepted

Firstly, see the comment on my answer here. If you're not able to reach either the www or non-www URLs for your website, see the second part of my answer here. If you are able to reach both and they return the same content, then proceed with the following.

Assuming that you're using IIS (for ASP.net):

1.) Create a 301 redirect from either www.mydomain.com -> mydomain.com, or the reverse (either is fine, though many prefer the non-www version).

For IIS 7.x, as covered here the steps are:

  • Download and install IIS URL Rewrite 2.0 if not currently installed
  • Open IIS Manager and double-click on the “URL Rewrite” icon
  • Click on “Add Rules…” from the Actions pane
  • Name the rule you're about to create (i.e., “Redirect mydomain.com to www”)
  • From the dropdown box select Wildcards
  • Enter * for the “Pattern”
  • Expand the “Conditions” section and click “Add”
  • In the “Add Condition” dialogue enter the following:

    Condition input: {HTTP_HOST}
    Check if input string: Matches the Pattern
    Pattern: www.mydomain.com (or mydomain.com if www is prefered)
    Ignore case: checked

  • Click OK

  • In the Action section make sure that the “Action Type” is set to Redirect
  • For the “Action Properties”, enter http://www.domain.com/{R:0} (or use mydomain.com if www is prefered)
  • Be sure that the “Append query string” remains checked so that the querystring part is also retained
  • Be sure that the “Redirect Type” is set to Permanent (301)
  • Apply the rule and test

In Google Webmaster Tools, be sure to set your Preferred domain (www or non-www)

2.) See my answer here.

Lastly, it's always a good idea to do a little research to verify SEO advice, as there's lots of questionable information out there that can result in more work than is necessary, and sometimes result in additional problems for your site too.

share|improve this answer
    
Thank you so much @dan, I have followed your instructions above and was successful. Cheer! Despite the warning as I've noted above are harmless but Google Analytic to avoid duplicate content capture, duplicate statistical data, the data that I need to increase SEO on Google Search and Google need to verify the most accurate way of user data visit our website(link). –  xmencute Dec 20 '13 at 16:55
    
No problem - sounds good. Hope to see other questions from you here in the future! –  dan Dec 20 '13 at 17:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.