Regex 正则表达式和重定向插件

Regex 正则表达式和重定向插件,regex,wordpress,redirect,plugins,Regex,Wordpress,Redirect,Plugins,我的博客最初设置如下:/blog/ 一段时间以来,情况如下:/posts-2/ 我需要知道从/blog/到/posts-2/ 下面是我得到的(许多)404的一个例子:mysite.com/blog/post name/ 此外,我需要能够将其与date/permalink解决方案结合使用, 资料来源: 如有任何意见,将不胜感激 尝试将其添加到.htaccess文件中: RewriteEngine On RewriteBase / RewriteRule ^blog(/.*)?$ http://%{

我的博客最初设置如下:
/blog/

一段时间以来,情况如下:
/posts-2/

我需要知道从
/blog/
/posts-2/

下面是我得到的(许多)404的一个例子:
mysite.com/blog/post name/

此外,我需要能够将其与date/permalink解决方案结合使用, 资料来源:


如有任何意见,将不胜感激

尝试将其添加到.htaccess文件中:

RewriteEngine On
RewriteBase /
RewriteRule ^blog(/.*)?$ http://%{HTTP_HOST}/posts-2$1 [R=301,L]
(我不明白你关于日期/永久性的问题的最后部分)

RewriteEngine On
RewriteBase /
RewriteRule ^blog(/.*)?$ http://%{HTTP_HOST}/posts-2$1 [R=301,L]