我正在尝试使用 RewriteRule(使用 ISAPI,而不是在 Apache 服务器上)来 301 重定向 url,例如:
到
到目前为止我得到的是:
RewriteRule ^news/(?!detail)/?$ news/detail/$1/ [L,R=301]
它成功忽略了其中已经包含“详细信息”的网址(在我的一些第一次尝试中,我最终得到了一个循环和一个类似“/news/detail/detail/detail ...”的网址),但访问/news/ story-title/ 给了我一个 404 所以它没有重定向到正确的位置。