如何将一个 WordPress 安装重定向到另一个(两者都在同一域的子目录中)?
把我的头发拉到这上面。
我在 /2009 安装了一个 WordPress,在 /2010 安装了一个。我正在尝试将所有对 2009 年网站的请求重定向到 2010 年网站。我已经在根 .htaccess 和 /2009 .htaccess 中尝试了这两种方法:
RewriteRule ^2009.*$ 2010 [R=301,L]
RewriteCond %{REQUEST_URI} ^2009.*$
RewriteRule . 2010 [R=301,L]
但是 2009 站点不断加载。有什么想法吗?
Pulling my hair out over this one.
I have one wordpress install at /2009 and one at /2010. I am trying to redirect all requests to the 2009 site to the 2010 site. I have tried both of these in the root .htaccess and in the /2009 .htaccess:
RewriteRule ^2009.*$ 2010 [R=301,L]
RewriteCond %{REQUEST_URI} ^2009.*$
RewriteRule . 2010 [R=301,L]
But the 2009 site keeps loading. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是为了澄清:
您在服务器上安装了 WordPress,地址为 /Document/root/2009,可以在浏览器中查看 http://server/2009,并且 wordpress 安装在 /Document/root/2010,可在浏览器中查看 http://server/2010,正确吗?
最简单的方法是登录到服务器,cd /Document/root 并执行以下操作:
如果您没有对相关服务器的 shell 访问权限,那么第二个最简单的方法是在 2009 年将 index.php 重命名为 wordpress 并加载这个index.php到它:
Just to clarify:
You have a wordpress install on the server at /Document/root/2009, viewable in a browser at http://server/2009, and a wordpress install at /Document/root/2010, viewable in a browser at http://server/2010, correct?
The easiest thing to do is login to the server, cd /Document/root and do this:
If you do not have shell access to the server in question, then the second easiest method is to rename the index.php for wordpress in 2009 and load this index.php to it: