【发布时间】:2013-08-21 10:34:18
【问题描述】:
我目前正在合并我们最近收购的网站上的帖子,该网站安装了多个 WordPress 来管理内容,一个在 public_html 文件夹中,另一个在子目录中,如下所示:
1. http://domain.com/
2. http://domain.com/another-install/
我们正在将所有内容从 /another-install/ 移到主设置中,并使用 301 重定向从所有旧链接中删除 /another-install/,如下所示:
RedirectMatch 301 ^/another-install/(.*) http://domain.com/$1
导致所有文章都像这样重定向:
http://domain.com/another-install/article-name/
TO
http://domain.com/article-name/
问题是,我们希望保持/another-install/ 作为页面可见。通过当前重定向,http://domain.com/another-install/ 转到 http://domain.com/。有什么方法可以添加例外,或者重写当前规则,使其保持/another-install/ 可见?
【问题讨论】:
标签: regex wordpress .htaccess mod-rewrite url-rewriting