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:


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


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

Learn more about our team.

  • http://pinhasov.com Kobi

    I use this in my web.config:

  • http://directory.rankedlisting.com/search.html?q=equip.pl Chase Vanderwood

    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!

Recent Posts

  • HowTo: make out Retweet-counter in a random URL

      Twitter offers some interesting functions with the integration of the twitter button – every user can see how often the website has been retweeted and he can do the same with just one click. But of course the whole thing has his price: - The integration of the Twitter JavaScript makes the whole data […]

  • Time-controlled Azure WebJobs – Azure as easy as it get‘s

        While still in development the Azure WebJob SDK offers some cool features for procession and supply of information. A good example is the sample that observes the Azure Queue and processes an item as soon as it spots one.   Scenario: time-controlled activities – without queue and so on My scenario was quite […]

  • image2021-570x194_thumb.png
    HowTo: Create RSS Feeds with ASP.NET MVC

    I’ve already written about how to consume RSS or Atom Feeds with the SyndicationFeed (in German, sry) but todays post is about how to create or publish an own feed. Beside the age of the feed standard and the much defamation from Facebook, Twitter and Google on RSS/Atom I consider this easy to consume API […]

  • image1997-311x194_thumb.png
    How to access an Azure Website with the local IIS Manager

    Since the end of February it is possible to access an Azure Website with the IIS Manager. Although the Azure Management site offers some information there are more details visible at the IIS Manager. For the connection you will need an IIS Manager and the IIS Manager for Remote Administration Extension. It’s also possible to […]

  • image1929-570x143_thumb.png
    Create and validate own Json-Web-Tokens (JWTs)

    If you are interested in web authentication you probably have heard about JSON Web tokens (JWT). What is a JWT? Maybe I’m not using the correct security termination but however: JWTs are used to exchange claims between two systems. For example: You want to log on to a service (like Facebook, Twitter, etc.) and want […]

Support us