How To: Prevent running ASP / ASP.NET code in specific folder

Sometimes, you may want to prevent running ASP or ASP.NET code in specific folder, for security reasons for example.
In this case, you have to follow these instructions (Windows Server 2003, IIS6):

  1. run inetmgr, the IIS management consoleimage
  2. Right-Click on the folder you want to disable ASP/ASP.NET inside
  3. Open the properties window.
  4. image In the "Directory" tab, in the "Execute Premissions list, choose "None". Now, It's impossible to execute ASP files or CGI scripts in this folder.
  5. Make an application for this folder, by clicking "Create" button.
  6. Click on the "Configuration" button.





  7. image In the "Wildcard application maps" section, choose the aspnet_isapi.dll item, and click Removee.

That's it!
Now, it's impossible to execute ASP or ASP.NET code on this folder.

Shahar.

509 Comments

Comments have been disabled for this content.