【问题标题】:Infinite redirect with AliasMatch apache使用 AliasMatch apache 进行无限重定向
【发布时间】:2016-12-13 04:21:14
【问题描述】:

我通过AliasMatch /hira/.*[^/] "/var/www/html/hira" 获得无限重定向

如果有人知道为什么那会很棒。

【问题讨论】:

    标签: apache httpd.conf


    【解决方案1】:

    DocumentRoot 设置为什么?如果DocumentRoot 设置为/var/www/html,这是许多发行版的默认值,你为什么要为/hira 使用任何别名指令?

    Apache Alias Documentation

    【讨论】:

    • Alias /hira/search "/var/www/html/hira" 有效,所以我虽然会遵循相同的格式但使用 AliasMatch。它只是继续/index.html/index.html/*
    • 在这种情况下,看起来文件系统路径末尾缺少一个变量,例如AliasMatch "^/hira/(.*)$" "/var/www/html/hira/$1"
    • 但是"/var/www/html/hira/$1" 不匹配(.*) 得到的任何东西?我希望 /hira 之后的任何内容仅重定向到 /hira
    • 它会,我想你想要的是Rewrite,例如this,例如RewriteCond %{REQUEST_URI} !^/hiraRewriteRule .* /hira [R=Permanent,L]
    猜你喜欢
    • 2018-09-09
    • 2015-07-09
    • 2016-10-17
    • 2011-01-15
    • 1970-01-01
    • 2012-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多