IP Restrict Directory


/ Published in: XML
Save to your folder(s)

place web.config in which ever directory you would like to restrict


Copy this code and paste it in your HTML
  1. <?xml version="1.0"?>
  2. <configuration>
  3. <system.webServer>
  4. <security>
  5. <ipSecurity allowUnlisted="false"> <!-- this line blocks everybody, except those listed below -->
  6. <clear/> <!-- removes all upstream restrictions -->
  7. <add ipAddress="127.0.0.1" allowed="true"/> <!-- allow requests from the local machine -->
  8. <add ipAddress="83.116.19.53" allowed="true"/> <!-- allow the specific IP of 83.116.19.53 -->
  9. </ipSecurity>
  10. </security>
  11. <modules runAllManagedModulesForAllRequests="true"/>
  12. </system.webServer>
  13. </configuration>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.