301在新旧URL中使用时redirect问题

我们正在尝试创build一组301redirect,其中来自旧url的确切string也出现在新url的相同位置。 看下面的例子:

旧的url

http://www.domain.com/foobar 

新的url

 http://www.domain.com/foobar/i55 

我们已经尝试了这样的标准301redirect:

 Redirect 301 /foobar$ http://www.domain.com/foobar/i55 

这不起作用,并导致404:

 File does not exist: /home/domain/public_html/foobar 

我们应该看一下重写规则吗,还是可以通过调整301规则来解决?

谢谢。

你需要在mod_alias中使用RedirectMatch,例如:

 RedirectMatch 301 /foobar$ http://www.domain.com/foobar/i55 

基于编辑的评论