Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have created a custom HttpModule to help with re-writing. It runs fine when I run out of VS but as soon as I try run it on IIS I get the following error:

The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.

Thanks in advance.
Posted

You haven't told us which version of IIS you are having this problem with. Assuming that it is IIS 7, you should find details on how to solve this here[^].
 
Share this answer
 
Comments
DominicZA 19-Jul-11 7:31am    
Sorry, there version of IIS that I am using is 7.5, and your solution doesnt really help because there is no setting called ISAPI and CGI Restrictions. They are separate options in 7.5
Pete O'Hanlon 19-Jul-11 7:39am    
Ah. Take a look at the details of what you need to do here: http://frejnorling.wordpress.com/2011/02/13/configure-iis-7-5-to-manage-asp-net-4-0-web-pages/
Their are two things which you should look for.

First:
Open your IIS(7.5).
Select Root/Server level.
Select "IsAPI and CGI Restrictions" from Right Panel.
Allow permissions.


Second:
When you run your Asp.Net application from IIS, your HttpModule needs to be registered in "system.webServer" section of web.config as below.

<system.webserver>

	  <modules runallmanagedmodulesforallrequests="true">

		  <add name="NameOfHttpModule" type="TypeOfHttpModule" />
		  
	  </modules>

  </system.webserver>


This should resolve your problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900