Avoid „Duplicate Content“ with IIS7 – Domain with or without www

If you are the owner of a domain like “foobar.de” you need to make a decision: with or without www?

With or without www?

It’s not so easy to find an answer to this question. I prefer the www option because it’s possible to set a C-Name for a “www” Subdomain. The C-Name is important if you want to run your own Web application on you own Domain on Windows Azure.

I found two more articles about this subject but they are a little bit older.

Important: you need to decide!

If the website is addressable with and without www then Google will evaluate the Content as “double” – the result will be negative for the search engine Google optimization.

What’s the easiest way to reach this wit IIS

image1394Our blog for example is meant to be addressable with the non-www option so I’ve created the “Code Inside” side. Code-inside.de is the only address the side will react on.

The other side www.code-inside.de will only react on the www-option.

 

 

 

Redirect in IIS

There is a very simple way to create a redirect in IIS:

image

Enter the destination address and set the state on “Permanent (301)”.

image

This way will work but maybe you will have many “Dummy” sides in IIS only for the Redirects. But at least it’s very easy and it works – for me Zwinkerndes Smiley

Other options: with web.config

Of course there are some other possibilities like for example there are some interesting ways in IIS with Rewrite Rules. To say the true: I didn’t work with this so far. Maybe someone knows the suitable Snippet for the transmission from www to non-www? Smiley mit geöffnetem Mund

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

About the author

Written by Code Inside Team

Learn more about our team.

2 Responses

  1. I use this in my web.config:

    Reply
  2. This is the appropriate blog for anyone who needs to search out out about this topic. You notice a lot its almost onerous to argue with you (not that I actually would want…HaHa). You undoubtedly put a brand new spin on a topic thats been written about for years. Nice stuff, simply great!

    Reply

Comment on this post

Recent Posts

  • Automated Security Analyser for ASP.NET websites

    Evil Hackers are lurking everywhere and many Web-applications are delicately and share “too much” with the attacker. A quick (first!) overview offers the Tool “ASafaWeb”. All the website does is making a few requests and writing an Analyses including problem solving’s. There are no permanent disadvantages (bad requests/ DoS attacks and so on). Example: KnowYourStack.com ...

  • image1489-570x194.png
    „Sign in with Twitter“ for your own ASP.NET WebApp

      “Sign in with Twitter” is a popular practice to authenticate the users on your website. One advantage compared to an own registration is the lower inhibition for the user. But on the other hand Twitter doesn’t fess up with all the information’s and you will get into a kind of addiction. At the end ...

  • image1485-570x194_thumb.png
    CodePlex is going to be updated

      CodePlex the Microsoft Open Source Project Hosting Plattform hasn’t changed that much in the last few years and for a few times I thought Microsoft stopped the whole developing process. But now I found out that there is still life in the project. Maybe it is because of the success of GitHub or because ...

  • image1474_thumb.png
    What does Adobe in the flash-free web? Magazine-Style Layouts with CSS Regions!

      Adobe is well known for Photoshop and Flash but of course there is a lot more. According to the “Future Post” from Google Adobe declared one of their big subjects on a Blogpost. I’m talking about the W3C Working Draft to CSS Regions. Adobe cooperates with the WebKit Team and W3C on this. What ...

  • image1471-523x194.png
    HTML 5 Games, Tooling & 3D

      Game Developing is an interesting subject for all kind of software developer. But as a web developer without any Flash-skills there aren’t that much starting points. With HTML5 and the combination between Javascript, CSS3 and fast browsers there are the first “robust” HTML5 games. HTML5 games? Is this real? Neowin created a “Top 10” ...

Support us