Deny access to .axd in IIS 7.0 based on IP address

664 Views Asked by At

I want to be able to deny access to all but a defined set of IP addresses for a particular .axd in IIS.

At the moment, I'm doing this in the code for the axd (it's a managed handler written in C#)

Is there a way I can do this through configuration (ideally changing web.config) ?

Thanks!

1

There are 1 best solutions below

0
On

Here is how I did this using IIS6:

  • Create a dummy blank text file for the handler in the proper directory myhandler.axd
  • Navigate to the file in IIS Manager, Right-Click, Properties
  • Set authentication, IP address restrictions in the File Security tab

Caution: the settings seem to persist even if the dummy file is deleted.