Asp – deny ASP.NET anonymous access to all files

asp.netauthentication

My hypothetical website doesn't allow anonymous access and uses Forms Authentication. So the initial request for www.example.com/SomePage.aspx is redirected to www.example.com/Login.aspx?ReturnUrl=SomePage.aspx.

However users can still access URLs that aren't served by ASP.NET, e.g.: www.example.com/Images/AnImage.jpg or www.example.com/TextFile.txt.

Is it possible to deny anonymous access to these files and use the same Forms Authentication?

Best Answer

Yes - You must register ASP.NET for every file (.*) extension. this you have to configurate in ISS.

Related Topic