Mobile app version of vmapp.org
Login or Join
Rivera981

: Canonicalization for www/non-www URLs and IP/domain on a Windows server I have checked my website using this SEO tool and the results report 2 issues: Test your site for potential URL canonicalization

@Rivera981

Posted in: #301Redirect #CanonicalUrl #Iis #Seo #UrlRewriting

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 mydomain.com and
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.


mydomain.com and mydomain.com should resolve to the same URL, but currently do not.
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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Rivera981

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

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 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: 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 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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme