我需要在IIS7服务器上进行一些基本身份验证,但我不希望它显示在192.168.0.x范围内。
对于.htaccess,它会是这样的:
Deny from all
Order deny,allow
AuthName "myauth"
AuthUserFile .htpasswd
AuthType Basic
Require valid-user
Allow from 192.168.0.
Satisfy Any
THX〜
答案 0 :(得分:1)
这样的事情可以吗?:
<configuration>
<location path="..">
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<basicAuthentication enabled="true" />
</authentication>
<ipSecurity allowUnlisted="false">
<add ipAddress="192.168.100.0" subnetMask="255.255.255.0" allowed="true"/>
</ipSecurity>
</security>
</system.webServer>
</location>
</configuration>