【问题标题】:403 Forbidden on PHP page called with url encoded in a $_GET parameter403 Forbidden on PHP page called with url encoding in a $_GET 参数
【发布时间】:2009-07-06 23:55:32
【问题描述】:

给定 hello.php:

<?php echo "Hello"; ?>

渲染页面工作正常并返回Hello,但是

http://example.com/hello.php?test=http%3a//whatever.com

返回 403 禁止。但奇怪的是,使 http 的第一个字母大写可以正常工作:

http://example.com/hello.php?test=Http%3a//whatever.com

仅供参考,斜线的百分比编码也是 403s:

http://example.com/hello.php?test=http%3a%2f%2fwhatever.com

我开始怀疑这可能是Passenger(我用来服务RoR)的问题

【问题讨论】:

    标签: php query-string


    【解决方案1】:

    是 mod_security 的 10_asl_rules.conf 导致了这个错误。

    【讨论】:

    • 你能解释一下如何解决这个问题吗?
    【解决方案2】:

    也许您的 htaccess 正在接收该 URL 中的某些内容并发送禁止的标头。你有 .htaccess 文件吗?

    【讨论】:

    • 当然,但不会影响到这一点。
    猜你喜欢
    • 2018-09-03
    • 1970-01-01
    • 2015-05-18
    • 1970-01-01
    • 2020-06-04
    • 2010-10-31
    • 2012-08-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多