Questions tagged «restriction»

3
Apache 2.4将URL限制为某些IP
我试图将特定的URL限制为只能在特定IP地址的网络外部使用。当外部用户尝试访问该URL而不是从IP列表访问时,应将其重定向到首页。 到目前为止,这是我尝试过的一切。最后一部分将所有用户重定向到首页,而不管IP。 <Location "/secret"> # <If "%{REMOTE_ADDR} != -ipmatch '123.123.123.123/255.255.255.255'"> # Redirect 303 "/secret" / # </If> RewriteCond "%{REMOTE_ADDR}" "!123\.123\.123\.123" RewriteRule .* / [R,L] LogLevel debug rewrite:trace6 </Location> PS:/ secret URL实际上是一个虚拟URL,并且实际上不在驱动器上。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.