【发布时间】:2014-10-17 12:00:30
【问题描述】:
我已经建立了一个需要重定向旧网址的网站。旧站点使用数据对象作为页面概念,因此可以在 example.com/news/view/my-post 找到博客条目。新站点使用博客模块,因此现在可以在 example.com/news/my-post 中找到博客条目。我尝试将以下重定向添加到我的 htaccess:
RedirectMatch permanent ^/news/view/(.+) http://www.example.com/news/$1
当我导航到旧帖子时,例如,使用上述 RedirectMatch 的 example.com/news/view/my-post,我得到以下网址:mysite.com/news/my-post?url= /news/view/my-post 并从 Silverstripe 获得 404
另一个奇怪的行为是,当我附加除 ?url=* 之外的任何内容时(例如 ?everything=everything,我没有得到 404 页面)。
Silverstripe 是否将 ?url=/news/view/my-post 附加到 url?如何添加 RedirectMatch 而不会收到 Silverstripe 的 404?
【问题讨论】:
标签: silverstripe