Redirect using IIS7

by Matti Lehtinen January 20, 2010 09:27

It is essential that the same content is found only under single URL. Alias URLs should be redirected to the main URL. Otherwise you may get "duplicate content penalty" by Google which gets your site lower on search results. E.g. if you have domains www.foobar.com and www.foobar.net, you want the .net to be forwared to the .com.

On IIS 7 redirection can be made by following steps:

1. Install IIS 7 Rewrite Module (Requires Reboot!)

2. Edit web.config file of your site. The code should be put under <system.webServer> element. The following example redirects from www.foobar.net, foobar.net and foobar.com to www.foobar.com.


<rewrite>
 <rules>
 <rule name="Redirect to www.foobar.com" stopProcessing="true">
  <match url=".*" />
  <conditions logicalGrouping="MatchAny">
  <add input="{HTTP_HOST}" pattern="^foobar\.net$" />
  <add input="{HTTP_HOST}" pattern="^www\.foobar\.net$" />
  <add input="{HTTP_HOST}" pattern="^foobar\.com$" />
  </conditions>
  <action type="Redirect" url="http://www.foobar.com/{R:0}" redirectType="Permanent" />
 </rule>
 </rules>
</rewrite>

Note that redirectType should be "Permanent". This creates "301 Moved Permanently" redirection which is most SEO friendly.

Tags: , ,

General | SEO

Comments

6/22/2010 5:12:20 AM #

Page rank

at www.seoworkbook.net  we support Search results marketing  (short for lookup motor advertising), let's begin above discover to get your site indexed, we explain what backlinks are and what the most effective methods for acquiring them are, we supply you computer software and tools that may help on the way and definitely we allow you to achieve your aim of being on the initial page on google.

Page rank Sri Lanka

7/15/2010 6:37:17 PM #

билеты онлайн

It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues.

билеты онлайн Russia

7/22/2010 1:44:19 PM #

kingdom heroes gold

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.

kingdom heroes gold Germany

7/22/2010 5:06:16 PM #

DFO Gold

Thank you for this blog.  Thats all I can say.  You most definitely have made this blog into something thats eye opening and important.  You clearly know so much about the subject, youve covered so many bases.  Great stuff from this part of the internet.  Again, thank you for this blog.

DFO Gold Germany

7/22/2010 5:26:28 PM #

DFO Gold

This blog has definitely changed my perspective on this subject.  Theres no way I wouldve thought about it this way if I hadnt come across your blog.  All I was doing was cruising the web and I found your blog and all of a sudden my views have changed.  Good on you, man!

DFO Gold Germany

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.6.0.0
Theme by Mads Kristensen | Modified by Mooglegiant