In this post, we will learn how you can use IIS URL Rewrite extensions to redirect domain.com to www.domain.com. IIS URL Rewrite extensions enables web administrator to enforce powerful rules to transform complex URLs into simple and consistent Web addresses. As well it also helps to produce user and search engine friendly URLs.

As you all know that by default, you can access website with or without WWW. For e.g. browsing hostforlife.eu and www.hsotforlife.eu will open same website. This means there are two different web addresses are available for one website and hence website’s SEO ranking will be distributed between these two addresses. To overcome these SEO ranking distribution, we can force all web traffic to redirect either domain.com or www.domain.com. Google web masters tool also allow web master to set preferred domain for indexing website URLs. So conclusion is that redirecting all web traffic to only one primary domain or canonical domain can improve SEO ranking. Just follow these steps with IIS.

Step 1

Connect to website through IIS manager and click on URL Rewrite icon.

Step 2

In Actions pane click on Add Rules.

Step 3

In Add Rules dialog box click you can find several predefined rule template. Click on canonical domain name template under search engine optimization section.

Step 4

It will open dialog box to select primary domain for website. Choose appropriate options.

Step 5

Press ok. You have done it. Now all your web traffic will be redirected to primary domain you have selected. And you can see added rewrite rule in list pane. But just using predefined rule template is not enough for web administrator. We should also dig into rule settings done by this rule template. For examine settings of created rule select rule in list pane and double click on it or click on Edit Rules link in Action Pane.

Step 6

It will open edit inbound rule window. Scroll down to bottom of window. There you will find Action sections. In action sections, there is one drop down named Action Type. Default value of Action Type is redirect. Expand Action Type drop down to see different actions available for this rule.

Step 7

And below action type drop down there is another drop down Redirect Type. Default value of this is Permanent (301). Expand drop down to see list of available other redirect type.

Setting redirection type Permanent (301) will cause to send HTTP 301 status code and then after it will redirect to primary domain. So search engine can index appropriate URLs.

HostForLIFE.eu IIS 8.0 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.