将 WordPress 永久链接从 postname 迁移到 post_id/postname
我的博客已经上线一年左右了,90% 的流量来自 Google,所以我想确保正确处理此永久链接更改。我最近在 Wordpress 的法典上读到,在永久链接的开头包含数字 %post_id% 可以大大减轻获取帖子或页面时数据库的压力。因此,我决定将永久链接结构从 /%postname%/ 更改为 /%post_id%/postname/。
现在,如果我输入或单击 Google 中指向我网站的链接,如下所示 - http:// /blog.com/cool-post/,它似乎重定向到我的新结构: http://blog.com/34424/cool-post/ 顺利进行。我想知道是否需要使用 301 重定向插件。我想像谷歌这样的搜索引擎会看到我所看到的同样“完美”的重定向。似乎没有任何损坏的链接。只是想确认一下这次改变后我会没事的。
谢谢
My blog's been up for a year or so, and 90% of our traffic comes from Google, so I want to make sure that I'm handling this permalink change properly. I recently read on Wordpress' codex that including the numerical %post_id% at the beginning of your permalinks can greatly reduce the stress on your database, when a post or page is being fetched. So, I decided to change my permalink structure from /%postname%/ to /%post_id%/postname/.
Now, if I type in, or click on a link to my site in google that looks like this - http://blog.com/cool-post/, it seems to redirect to my new structure: http://blog.com/34424/cool-post/ without a hitch. I'm trying to figure out whether I need to use a 301 redirect plugin or not. I would like to think that search engines like Google will see the same "flawless" redirection that I'm seeing. There doesn't seem to be any broken links. Just looking to confirm that I'll be okay after this change.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
WordPress 通过适当发送 301 Moved Permanently 状态代码来为您处理规范重定向。该状态代码确保 Google 只会通过新网址(即永久链接中的帖子 ID)对您的帖子进行索引。我已经有一段时间没有使用重定向插件了,我的网站也已经被类似地索引了。
WordPress handles canonical redirects for you by sending 301 Moved Permanently status codes appropriately. That status code ensures Google will only index your posts by the new URLs (i.e. with the post IDs in your permalinks). I've not used a redirection plugin for a while and my sites have been indexed similarly just fine.