Reputation:
I'm pretty new in developing for VB.NET. I have a web application and I want to block the access to the files in a directory.
For example:
If the user access the following page: application.com/example/page.aspx
If the user remove the page name and type "application.com/example/", he will see all the files inside the folder "example".
I want to block this possibility and, when a user try to access the files, redirect to an error page.
I know how to solve this in PHP through htaccess, but I have never done it by VB.NET. Any help?
Upvotes: 0
Views: 81
Reputation:
web.config or .htaccess will do.
Remember it is a security risk to have directories open for anyone to see.
Upvotes: 0
Reputation: 129
If you are using IIS then Go to your sites-->Desired Site
From Features Views Select Directory Browsing disabled.
Upvotes: 2