RedirectMatch不起作用

时间:2013-03-15 07:20:18

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

我想告诉我的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)到新的url:/ newEndPoint / services / Tutu / toto。

我已尝试使用此规则,但它不起作用,不会出现重定向:

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

谢谢!

1 个答案:

答案 0 :(得分:0)

对于简单的重定向,您不需要RedirectMatch

请仅查看Redirect。您必须先提供旧网址,然后再提供新网址

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