Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

iis 7.5 ipSecurity denyAction=NotFound causes 500 error instead of 404

$
0
0

I'm restricting access to certain folders in an IIS 7.5 web application based on IP address. Here is a segment from applicationHost.config:

<ipSecurity allowUnlisted="false"><add ipAddress="172.16.0.0" subnetMask="255.240.0.0" allowed="true" /></ipSecurity>

This returns a 403 Forbidden page and works as expected. But, I want it to return 404 Not Found instead. When I try the following code, however, I instead get a 500 error:

<ipSecurity allowUnlisted="false" denyAction="NotFound"><add ipAddress="172.16.0.0" subnetMask="255.240.0.0" allowed="true" /></ipSecurity>

I've searched on Google but have found no answer.


Viewing all articles
Browse latest Browse all 780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>