Connect Tech Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, 23 June 2012

Enable Canonical URL in IIS7 for SEO

Posted on 06:29 by Unknown
What is URL Canonicalization? – Its just nothing but you are making sure that your users and the search engines are accessing your websites on your preferred domain name only like either www.website.com or website.com.


Why URL Canonicalization? – Well Its for avoiding the confusion of Search Engines that you are having a duplicate website where you are really having one. If you keep allow accessing your website by both www.website.com and website.com separately search engines will think both are different websites. So its mainly for SEO purpose we do canonicalize the URLs. Search Engines treat websites that can be accessed by more than one domain name, such as   www.website.com and website.com, as if they are two different sites. This affects the page ranking for the website.


Enable canonical url in IIS7 simply by pasting the below code to your web.config.

Code for URL Canonicalization :
<configuration>
<system.webServer>
<!--Code for URL Canonicalization Starts Here-->
<rewrite>
<rules>
<rule name="CanonicalHostNameRule1">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.website\.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://www.website.com/{R:1}" />
</rule>
</rules>
</rewrite>
<!--Code for URL Canonicalization Ends Here-->
</system.webServer>
</configuration>
This permanently redirects (301 redirect) every requests comes to smartadmins.org or its sub-urls to  www.website.com and its corresponding sub-urls seo friendly.

You can use it by just replacing the domain name with your own, in your shared hosting easily on following conditions.
1. Your hosting server must be installed with URL Rewrite Module
2. Managed Pipeline Mode of your Application Pool must be Integrated
So what if you are having a new Windows Dedicated Server, well lets do that easily by few clicks as shown below, but ofcourse only if you have administrator access ;-)
Steps to Enable Canonical URLs in Dedicated Windows Hosting
First you need to download IIS URL Rewrite Module
Download URL Rewrite Module for your 32bit Server Edition (x86)
Download URL Rewrite Module for your 64bit Server Edition (x64)
Check your Server edition and download corresponding msi packages and just install it by double clicking the downloaded msi and by following the steps.
Now after finishing the setup just open your IIS Manager and expand your sites section and click on your domain name you need to enable canonical URL.
Step 1: Now as shown in the below screenshot click on the URL Rewrite option under IIS section of your website

Step 2: On the URL Rewrite window click on Add Rule on the top right corner, and the Rules window just click on the Canonical domain name under Search Engine Optimization (SEO) section and click OK















Step 3: Now select your preferred domain name to set as canonical url (either www url or non-www url as primary domain name) and click OK

Thats it!!! You just activated canonical url for your ASP.Net website :-)
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • How to schedule a PHP script in task scheduler
    Quiet often there is a need to execute/run  php  script on some time interval at server side. And that php scripts should run automatically ...
  • HTTP Error 403.19 – Forbidden The configured user for this application pool does not have sufficient privileges to run CGI applications.
    If you get the error “HTTP Error 403.19 – Forbidden The configured user for this application pool does not have sufficient privileges to...
  • Roles and Features showing an error HRESULT: 0x800F0818 in Server Manager of windows server 2008 R2
    When you open Server Manager both Roles and Features display Error and you are unable to add any role or features. When you select the det...
  • How to configure IIS 7 to redirect non-www domain to www domain?
    One of few legacy leftovers that was never dropped over the years is the common use of www domain prefix. It is not a problem per se for us...
  • Error - "Failed to retrieve data for this request (Microsoft.SqlServer.Management.sdk.sfc)"
    ErrError    - In Microsoft SQL Management Studio 2008, you receive the following error message when you try to expand the Databases:      ...
  • Reset Mysql root Password using my.ini
    Follow the below given steps to reset the Mysql root password : 1.Browse to your MySQL installation directory. 2. In there, go to "Data...
  • Disallowed Parent Path
    If you are unable to access the website and facing the below error: Active Server Pages error 'ASP 0131' Disallowed Parent Path /adm...
  • How to resolve Windows Login Error: "An unauthorized change was made to Windows"
    After connecting to windows server via RDC, you receive error “ An unauthorized change was made to Windows ” Resolution: 1) Click the opt...
  • How to upgrade Zen Cart 1.3.9 to Zen Cart 1.5
    To upgrade your Zen Cart 1.3.9 to Zen Cart 1.5, follow the following steps. (For this tutorial, I assume you are using cpanel web hosting) 1...
  • Block IP from accessing website using .htaccess
    Block IP from accessing website using .htaccess To block certain ip address from accessing your website, just create a file with name .hta...

Categories

  • booting Process
  • linux
  • redhat

Blog Archive

  • ►  2013 (68)
    • ►  July (1)
    • ►  May (2)
    • ►  April (11)
    • ►  March (54)
  • ▼  2012 (44)
    • ►  September (20)
    • ►  August (1)
    • ►  July (4)
    • ▼  June (12)
      • Enable Canonical URL in IIS7 for SEO
      • How to disable web.config Inheritance for Child Ap...
      • New in IIS 7 - App Pool Isolation
      • Application Pool Identities
      • Ensure Security Isolation for Web Sites
      • Getting Started with AppCmd.exe
      • Introduction to ApplicationHost.config
      • How to Capture ASP.NET Page Trace Events in IIS 7....
      • Installing and Configuring Web Deploy
      • Classic ASP parent paths are disabled by default
      • Classic ASP Script Error Messages No Longer Shown ...
      • Classic ASP Not Installed by Default on IIS 7.0 an...
    • ►  May (2)
    • ►  March (4)
    • ►  February (1)
  • ►  2011 (1)
    • ►  February (1)
  • ►  2009 (9)
    • ►  September (3)
    • ►  August (2)
    • ►  June (1)
    • ►  May (2)
    • ►  March (1)
Powered by Blogger.

About Me

Unknown
View my complete profile