IIS 7 HTTP Redirects & Host Headers

I just learned something interesting about HTTP Redirects in IIS 7.  I’ve not yet read a lot of details about the inner workings of IIS 7, but I was surprised by this new discovery.  Long story short, HTTP Redirects are not applied purely at the site level, but are also tied to the physical path.

I have two websites, each one a separate site in IIS, that both point to the same physical folder (they are both DotNetNuke sites and they use the same DNN installation).  I added an HTTP Redirect to one of the sites (I wanted to point my personal DNN site to my new BlogEngine.Net site).  I didn’t think to check that the other site was unaffected until someone told me that it was also pointed to my blog.  What the hell?  It turns out that site that is pointed to the same physical folder will share the HTTP Redirect settings.  This is of course a very easy fix, but I am a little surprised by this behavior.

Hope this helps someone.

Happy coding,

Tom Hundley
Elegant Software Solutions

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s