永久链接从%day%更改为%id%后,Wordpress 301重定向
问题描述:
On a Wordpress blog, with posts permalink setup like this: /%year%/%month%/%day%/%post_name%/
How to massively change the permalinks to this: /%post_name%-%post_id%/
.
I have about 10,000 articles.
- Change the permalink from wordpress settings - done.
- Create a redirection for all link
/1970/01/01/this_is_a_post/
How to do the step 2?
People will arrive on /1970/01/01/this_is_a_post
but they will find a 404 as the post is now under /this_is_a_post-00022
.
在Wordpress博客上,使用帖子 em>永久链接设置如下: 如何将永久链接大量更改为: 如何执行第2步? p>
\ n 人们将到达 /% 年%/%月%/%天%/%post_name%/ code> p>
/%post_name% - %post_id% /
.
我有大约10,000篇文章。 p>
/ 1970/01/01 / this_is_a_post / code> li>
ol>
/ 1970/01/01 / this_is_a_post code>,但是他们会找到一个404,因为帖子现在在
/ this_is_a_post-00022 code>下。 p >
div>
答
Try this...
- Download the WordPress Simple 301 Redirect plugin: https://wordpress.org/plugins/simple-301-redirects/
- Create a redirect and enter the following in the request field:
/%year%/%month%/%day%/%post_name%/
and the following in the destination field:/%post_name%-%post_id%/
- Voila! You're all done.