【发布时间】:2010-10-29 21:09:24
【问题描述】:
自从我弄乱 .htaccess 以来已经有一段时间了,我似乎无法完全正确。我有一个站点,例如 example.com,我希望 example.com/* 重定向到 example.com/collector.html except 以获取我想要的子目录 example.com/special 下的 URL继续工作。
例如:
- example.com/page.html 应该重定向到 example.com/collector.html
- example.com/foo/bar 应该重定向到 example.com/collector.html
- example.com/special/page.html 不应重定向
我本来以为是这样的
RedirectMatch 302 ^/[^(special)]/.* /collector.html
RedirectMatch 302 ^/[^(collector.html)/]* /collector.html
可以解决问题,但它似乎没有按我想要的方式工作。
【问题讨论】:
标签: .htaccess redirect mod-alias