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

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
  • 5
  • 2
LVL 27

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: https://technet.microsoft.com/en-us/library/cc725855(v=ws.10).aspx

LVL 80

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 27

Expert Comment

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.


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 27

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 27

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 27

Expert Comment

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


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

856 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