Tuesday, 4 August 2009

Solution: IIS - You Are Not Authorised To View This Page

If you're setting up a new site on IIS, and occasionally (usually after you lock your workstation and log back in, or if you leave it for a long period of time) when you attempt to view a site on your localhost or on another remote machine using IIS - you might see the page displayed which says:

"You are not authorized to view this page (Error 401.1)"

If you're allowing anonymous access to your site using the IIS account, a temporary workaround is to run an iisreset at the command line. But a longer term (and less irritating) solution is to go into the Directory Security properties of your Virtual Directory in IIS configuration and uncheck the box which says "Allow IIS to control password".

Then do an iisreset and the error shouldn't appear again, unless there are deeper problems with your security set up.