0

我有以下设置:

http://example.com/foo/cake1.php
http://example.com/foo/cake2.php
http://example.com/foo/cake3.php

当我用户访问时:

http://example.com/foo

我想将它们发送到:

http://example.com

并保存

http://example.com/foo/cake[1-3].php

等等

我试过了:

Redirect /foo /

但这会重定向 foo 下的所有内容。我只想将 foo 重定向到根目录。我怎样才能做到这一点?

4

1 回答 1

0

终于想通了:

RedirectMatch 301 ^/foo/$ /
于 2013-03-08T00:00:32.900 回答