【问题标题】:.htaccess block local ip address.htaccess 阻止本地 IP 地址
【发布时间】:2011-06-01 09:48:08
【问题描述】:

我在我们的 Intranet 上托管的 wampserver 上运行了 3 个应用程序。

我想阻止某个 ip 范围内的应用程序访问。所以我为每个应用程序编辑了 .htaccess 文件,如下所示。但是应用没有被屏蔽。

订单拒绝,允许 允许从 10.212.4。 全部拒绝

查看日志后发现客户端返回的ip地址不一样。由于我们所有的机器默认使用代理设置。

谁能帮我解决这个问题?

【问题讨论】:

    标签: apache .htaccess wampserver


    【解决方案1】:

    您可以使用 mod_rewrite 根据他们的“x-forwarded-for”标题来阻止他们。不过我不认为这是安全的,因为这些很容易伪造。

    查看这里的讨论:

    http://www.110mb.com/forum/empty-t26129.0.html

    【讨论】:

    • 谢谢我在 RewriteCond %{HTTP:X-Forwarded-For} ^10\.212\.4\.63$ [OR] RewriteCond %{HTTP:X-Forwarded- 上使用了这个 RewriteEngine For} ^10\.212\.4\.53$ RewriteRule .* - [F] order allow,deny allow from 10.212.4.63 allow from 10.212.4.53 deny from all but even when I access application from my allowed Ips its give 403 错误
    猜你喜欢
    • 1970-01-01
    • 2010-11-04
    • 1970-01-01
    • 1970-01-01
    • 2015-12-25
    • 1970-01-01
    • 2020-04-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多