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

Posted on 2016-07-29
Last Modified: 2016-09-21
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?

Question by:Vas
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
LVL 28

Expert Comment

by:Dan McFadden
ID: 41735486
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:

LVL 81

Expert Comment

by:David Johnson, CD, MVP
ID: 41736414
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
LVL 28

Expert Comment

by:Dan McFadden
ID: 41769897
Any additional info on whether your issue has been resolved?

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.


Author Comment

ID: 41770268
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?
LVL 28

Expert Comment

by:Dan McFadden
ID: 41770432
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.

LVL 28

Accepted Solution

Dan McFadden earned 500 total points
ID: 41770458
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.


Author Comment

ID: 41803702
I would like to select Dan's first answers as correct
LVL 28

Expert Comment

by:Dan McFadden
ID: 41808226
Vas, you can choose the solution yourself and indicate the best solution.


Featured Post

Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A procedure for exporting installed hotfix details of remote computers using powershell
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question