asp.net - Trying to secure all aspx files in a folder secure by IP address -


I would like to save an aspx file to ~ / secure / in a folder, which is specific I can access the aspx files of the IP address folder I added the following web.config file to folder, hoping that the parent web.config :

  & lt; Adds to configuration & gt; & Lt; system.webServer & gt; & Lt; Security & gt; & Lt; IpSecurity allowUnlisted = "false" & gt; & Lt; Clear /> & Lt; add ipAddress = "192.168.100.1" /> & Lt; add ipAddress = "169.254.0.0" subnetMask = "255.255.0.0" /> & Lt; / IpSecurity & gt; & Lt; / Safety & gt; & Lt; /system.webServer> & Lt; / Configuration & gt;   

The problem is that when I try to access any aspx pages in the folder, I get this error:

This configuration section It can not be used on this path when this section is locked at a parent level. Locking is explicitly set by default (override modestfault = "prohibition") or a location tag with override mode = "Disclaimer" or allow for legacy override = "incorrect" .

What do you think about this idea? I just want to include a web.config file in the folder and which implements the IP address authority. I like this idea because it's no-code and config only.

You can not do it in web.config website only

If you use IIS You can use the manager: open the IIS manager, locate the site, click the folder that you want to secure, then click on the IP address and domain reconstruction.

Also, specify "Specific actions in the panel" of the specified tasks in the panel, specify assignments for unspecified clients (i.e. prohibited or prohibited with prohibition).

This will generate the correct configuration for you.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -