Wednesday, November 16, 2005

401.1 error + anonymos access + multiple host headers


Well, that was a very lengthy sort of a case. The problem can be reproduced if you add some host headers for your site in IIS (5.1 or 6.0) and disable anonymous access for the whole site. Let's assume that you have two host headers added (test and test.mydomain). Disable anonyous login and try to access the site using test and test.mydomain. As a result, you have IIS login prompting window shown. After specifying correct(!) login credentials you are not able to authenticate and get nothing but the 401.1 error screen in IE. Note that however using the localhost host header doesn't cause any problem. The solution is to hack into Windows regisrty and add some keys. You can find official instructions here: http://support.microsoft.com/default.aspx?scid=kb;en-us;896861 After the actions described in the resource above are taken, you can tune up it a little bit more. Despite the fact that IIS login screen may still show up when you request test or test.mydomain hosts, now you are able to authenticate successfully with your login credentials. In order to make this annoying window disappear, you should add those sites (test and test.mydomain) to the list of Local intranet sites in IE. Good luck!