【问题标题】:RedirectMatch don't work重定向匹配不起作用
【发布时间】:2013-03-03 20:05:24
【问题描述】:

我想告诉我的 Apache 我想要一个重定向永久规则。

我的日志中有这两种点击:

xx.xxx.xx.x - - [15/Mar/2013:08:14:21 +0100] "POST /oldEndPoint/services/toto HTTP/1.1" 200 - 6003 -
xx.xxx.xx.x - - [15/Mar/2013:08:15:40 +0100] "POST /newEndPoint/services/Tutu/toto HTTP/1.1" 200 - 1316 -

我想告诉 Apache,当他收到对 /oldEndPoint/services/toto 的点击时,他应该永久重定向 (301) 到新网址:/newEndPoint/services/Tutu/toto。

我尝试过这个规则,但它不起作用,没有出现重定向:

RedirectMatch 301 /modBackend/moderation/facebook /modFront/services/Moderation/facebook

谢谢!

【问题讨论】:

  • /modBackend/moderation/facebook != /oldEndPoint/services/toto。还是我错过了什么?

标签: apache redirect url-rewriting rewrite http-redirect


【解决方案1】:

您不需要 RedirectMatch 进行简单的重定向。

请参见 Redirect。您必须先给出旧网址,最后给出新网址

Redirect /oldEndPoint/services/toto /newEndPoint/services/Tutu/toto

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-25
    • 1970-01-01
    • 2011-06-15
    • 1970-01-01
    • 2017-10-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多