Re: web.config problems...

ASP.NET VB.NET

web.config problems...


freek 06-18-2007, 7:30 PM
i have a web.config file in my admin folder. right now it protects the files but not the directory. it wont redirect back to the login page, i gives a "directory listing denied" error. it also dosen't like to protect .txt files.

any ideas...?

Re: web.config problems...


DeveloperBarn 05-28-2008, 2:11 PM
Post the content of your web.config file so we may help you troubleshoot.
Jason
Founder, DeveloperBarn Forums
http://www.developerbarn.com

No longer a WebHost4Life Customer

Re: web.config problems...


deanman 05-28-2008, 2:50 PM
Forms authentication -- which can be handled from within the web.config file --, applies only to ASP.NET files (.aspx etc.)!

In order to protect non-ASP.NET files -- such as '.txt' files etc. --, on IIS 6, you have to register those file extensions and their related handler in IIS. You can do that from you control panel (Set Script Map). Then, you have to write some code (the handler) to detect access to those files and to take the appropriate actions such as blocking.

Beginning with IIS 7, you can handle that stuff from within your 'web.config'.

Note: Special ASP.NET folders (App_Code etc.) and files (.aspx etc.) are protected by design and there is no special need to protect them.
I <3 WebHost4Life.com

Re: web.config problems...


DeveloperBarn 05-28-2008, 2:59 PM
You can protect entire directories and the files within using web.config:

http://msdn.microsoft.com/en-us/library/6hbkh9s7(VS.80).aspx
Jason
Founder, DeveloperBarn Forums
http://www.developerbarn.com

No longer a WebHost4Life Customer
webhost4life.com

Powered by Community Server, by Telligent Systems