I have a site hosted on IIS7 with a default document specified as default.aspx. This works fine but my app uses Forms Authentication and I want to disable Anonymous Authentication completely. When I do disable anonymous authentication for everything except the login page, everything works fine but the default document setting stops working.

With Anonymous authentication switched on if I visit http://mysite I get passed to http://mysite/default.aspx (which then redirects to the login page if the user hasn't already logged in)

If I disable anonymous authentication (leaving only forms based auth enabled) and I visit http://mysite I get a permission denied page from IIS. Yet, if I visit http://mysite/default.aspx directly then the site works fine.

I just want to disable anonymous authentication and have http://mysite go to http://mysite/default.aspx. Any ideas would be greatly appreciated.


Have you tried adding a defaultDocument entry in the "system.webServer" element of the Web.Config?

            <add value="Default.aspx" />

Also, the if you want the default page to show up to those who have not yet been signed into the application, you must allow access with an authorization section like below:

(in system.web)

 <location path="Default.aspx">
        <allow users="*"/>
  • This is what I've been doing, it works fine with anonymous authentication enabled. But when I disable anonymous and only have forms auth enabled then mysite doesn't work (but mysite/default.aspx does work). Turning off anonymous auth seems to break the default page section. – John Rabotnik Jun 22 '10 at 10:44
  • Have you added an authorization section to allow unauthenticated users access to the default page? Assuming you want the app to work like that? – Kenny Jun 23 '10 at 7:53
  • Do you have an URL routing configured in the web.config? That can mess with you default doc. – russau Dec 22 '10 at 2:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.