[英]Bulk 301 redirect
I have +10000 links which need to be redirected in wordpress: 我有+10000个需要在wordpress中重定向的链接:
error page 301 redirect
example.com/page1 to example.com/category1/page1
example.com/page2 to example.com/category1/page2
example.com/page3 to example.com/category1/page3
...
One category only and multiple pages. 仅一类,多页。 Is there a way to bulk redirect it via htaccess?
有没有办法通过htaccess批量重定向它?
edit: I solved this with Simple 301 Redirects plugin and Bulk Uploader addon 编辑:我用简单的301重定向插件和Bulk Uploader插件解决了这个问题
If, as you said, there's only one category , this should work: 如您所说,如果只有一个类别 ,则它应该起作用:
RewriteRule ^([a-zA-Z0-9\_\-]+) /category1/$1 [R=301,L]
Edit: I added the 301 Redirection and (L)ast flags as noticed by w3dk in the comment below. 编辑:我添加了301重定向和(L)ast标志,如w3dk在下面的注释中所示。 About the pattern, he's right about
[a-zA-Z0-9\\_\\-]+
being (maybe) too generic. 关于模式,他是正确的,关于
[a-zA-Z0-9\\_\\-]+
(可能)太通用了。 Anyway, with the details currently given by OP seems to be a good approach. 无论如何,OP当前提供的详细信息似乎是一个不错的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.