我在IIS中有许多网站,希望允许直接访问特定子网中的用户,然后为其他用户提供基本身份validation。
这里是我在Apache中需要的完全相同的function:
<Directory "/var/www/mydir"> AuthName "Access Test Site" AuthType Basic AuthUserFile "/var/www/passwordfile" require valid-user Satisfy any Order Deny,Allow Deny from all Allow from 10.0.1 </Directory>
我很想能够在IIS6和IIS7.5上做到这一点,但如果必须的话,我会采取一个或另一个。
对于IIS 7.5,我会考虑URL重写。 对于IIS6,请考虑ISAPI重写。
这里是URL重写论坛http://forums.iis.net/1152.aspx
查看ISAPI Rewrite( http://www.isapirewrite.com/docs/ )的此页面,并在页面中search“Dynamic authentication”。 他们介绍了如何处理authentication部分。