Solved

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

Posted on 2016-07-29
9
70 Views
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?


Thanks
0
Comment
Question by:Vas
  • 5
  • 2
9 Comments
 
LVL 26

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

Dan
0
 
LVL 78

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
0
 
LVL 26

Expert Comment

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

Dan
0
 
LVL 1

Author Comment

by:Vas
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?
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
LVL 26

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.

Dan
0
 
LVL 26

Accepted Solution

by:
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.

Dan
0
 
LVL 1

Author Comment

by:Vas
ID: 41803702
I would like to select Dan's first answers as correct
0
 
LVL 26

Expert Comment

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

Dan
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Join & Write a Comment

I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now