# IIS Host Header Bindings not working correctly

I have a Windows 2008 server with two websites.

The first site has bindings for example1.com and www.example1.com.
The second site has bindings for example2.com and www.example2.com.

Each of them has an IIS rule that redirects to the www version of the URL. The problem is that when I go to example2.com, it redirects to www.example1.com. www.example2.com works correctly. I have double-checked the bindings several times. I even deleted the second site altogether. The non-www version redirects to www.example1.com, and the www version gives an error that the page does not exist. I have rechecked the bindings and the rules multiple times. Any ideas? Do the bindings or rules get stored or cached anywhere else?

-
Do they share the same physical path, the 2 website root applications? –  Mathias R. Jessen Apr 4 '12 at 18:42
No, they go to two different paths. –  Mike Apr 4 '12 at 19:46
Try posting the effective website configuration. You can list it with: appcmd.exe list config -section:system.applicationHost/sites. appcmd.exe is found in C:\Windows\System32\inetsrv –  Mathias R. Jessen Apr 4 '12 at 19:59

I have found the solution to this issue. Both Firefox and Chrome cache 301 redirects. So, when I was testing the configuration prior to creating the second website's bindings, it cached them. Nothing that I was going to do on the server side would have fixed the problem until I cleared the cache on the browsers. Once I did clear the cache, everyone worked as expected.

-

Binding get saved in the metabase if I remember correctly. Try removing the site and re-setting it up. This should clear an inconsistencies with the bindings.

-
I have dropped and recreated each website, and the same behavior occurs. –  Mike Apr 4 '12 at 19:47
Sounds like a configuration issue. Can you list out what your redirect rule is, and exactly how you're doing it. URL Rewrite, etc? –  Tatas Apr 4 '12 at 19:49
@Tatas : The metabase is an IIS6 feature. In IIS 7.0, all websites and their bindings are configured in applicationHost.config –  Mathias R. Jessen Apr 4 '12 at 19:57