How to disable (not delete) a Handler Mapping in IIS?

How do you set a handler from Enabled to Disabled?

The only options I'm finding is "delete" which completely removes it from this page.

For example, if I wanted to disiable *.asps from running in this particular area of the site, what would I do so it goes up to the "Disabled" section?:

How to set a handler from Enabled to Disabled?

Who is Participating?
Dan McFaddenSystems EngineerCommented:
There is one other option... and it depends on your server's configuration.  By default, as you see in the image you posted, there are 2 disabled mappings.  Both of these mappings have the "execute" access permission granted to them.  By default, the Handler Mapping, does not allow mappings to entities with the execute access permission.  Forcing them to show as disabled.

If you do not want to remove the mapping from the site/vApp/etc., you could grant the specific handler mapping the "execute" access permission, at the vApp level, which would then disable the mapping.

1. In IIS Manager, select the site you want to work on.
2. Create/Add an Application.
3. Select the Application, go into the Handler Mappings feature
4. Select the mapping you want to disable.  Click edit.
5. In the Edit Module Mapping box, click Request Restrictions
6. From here, select the Access tab
7. Select the Execute radio buttom
8.  OK and Yes your way out.

The feature will not immediately refresh, but if you go out and click the parent site, and go back into the sub site's Handler Mappings feature, you will find the mapping is listed as disabled.

This works at the server scope, site scope and on both sub Application (vApp) and virtual directories.

My recommendation for vApp and vDir that their content shoudl not be under the main site's content directory.

Dan McFaddenSystems EngineerCommented:
To disable a handler mapping, you need to modify the permissions of the handler.

In IIS Manager:

1. right click the handler you want to disable
2. choose "edit feature permissions"
3. Remove "Read" and "Script" permission
4. OK your way out, which saves the change

This will block the handler from being used.  The mapping should now show as "Disabled" in IIS Manager.

Reference Link:

David Johnson, CD, MVPOwnerCommented:
For example, if I wanted to disable *.asps from running in this particular area of the site, what would I do so it goes up to the "Disabled" section?: You can't handler mappings are site wide. Assume you mean .aspx
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Dan McFaddenSystems EngineerCommented:
Any additional info on whether your issue has been resolved?

VasAuthor Commented:
Sorry for the delay guys, these notifications went to my spam folder.

Ok so there's no way to disable .aspx (or .php) from running in a SPECIFIC folder (and below)?  The only way is to disable the extension/handler mapping for the ENTIRE site?

I'm thinking there has to be a way to just affect one area of the site... maybe a separate web.config page in the subfolder?
Dan McFaddenSystems EngineerCommented:
You can create a virtual application under the root of your site which IIS would then treat as a separate entity.  You would have a web.config in the application directory associated with the virtual application.

You also will see that there are now configurable feature for this vApp.  What you can do is actually remove the handler from the vApp.  This will only affect the vApp and not the site's root.

If you even need to restore the handler mapping, there is an action command in the right column called, "Revert to Parent" this will store any changes made as they exist in the parent object.

In end effect, this will prevent the contents of the vApp from knowing what to do with a handler mapping points to (for example) .php.

VasAuthor Commented:
I would like to select Dan's first answers as correct
Dan McFaddenSystems EngineerCommented:
Vas, you can choose the solution yourself and indicate the best solution.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.