?
Solved

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

Posted on 2016-07-29
9
Medium Priority
?
320 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
[X]
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
9 Comments
 
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: https://technet.microsoft.com/en-us/library/cc725855(v=ws.10).aspx

Dan
0
 
LVL 82

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 28

Expert Comment

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

Dan
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

Dan
0
 
LVL 28

Accepted Solution

by:
Dan McFadden earned 2000 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 28

Expert Comment

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

Dan
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

The following article is comprised of the pearls we have garnered deploying virtualization solutions since Virtual Server 2005 and subsequent 2008 RTM+ Hyper-V in standalone and clustered environments.
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

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