Dynamic Robots.txt with ASP.NET 2.0

Posted by Carly Lyddiard on Nov 17th, 2007

The Problem

Scenario: You have an ASP.NET 2.0 website in IIS 6.0 that receives both http and http requests. Some people might link to the https versions of the page, but you really want Google (and other search engines) to only crawl http versions. There are relative links in the site, so you know that as soon as Google crawls one https link it is going to pick up the whole site. So as well as https links in the Google search results, you may also now have to contend with lower rankings because Google thinks there is duplicate content on the site (it sees the page in both http and https format).

You can see that Google recommends that you have a different robots.txt file for http and https, so that Google knows not to crawl the https version of your site. But how can you get IIS to serve up different versions of robots.txt?

The rest of this article is available at KleeneCode.net, where Amos and I are now posting all of our tech posts. You can read the remainder of this article here

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

News

Back in Australia. Living, working and adventuring in Melbourne.

Tweet

Trip Stats

  • Time away: 11.5 months
  • Continent: South America
  • Countries visited: 5
  • Total time in buses: 245 hours
  • Highest altitude: 5000m
  • Times sick (food/water): 0
  • Protests/riots witnessed: 5
  • Times asked for money: ∞
  • Times "Gasolina" song heard: ∞
  • Flaites spotted: ∞
  • Times called "Gringa": 0
  • Times misunderstood: always
  • Times confused by Spanish: ∞
  • Times lost: >10
  • Fiestas: uncountable
  • Cool people met: ∞
  • Llamas encountered: thousands
  • Famous llamas encountered: 1
  • Times¨"shall I be mother" heard: too many
  • % Brits who love Shane Warne:100
  • Nerd jokes from Scott: ∞

Categories

Blogroll

Meta: