【问题标题】:Remove post_id from WordPress permalink and redirect old url's to new url从 WordPress 永久链接中删除 post_id 并将旧网址重定向到新网址
【发布时间】:2017-04-05 17:58:16
【问题描述】:

我在永久链接中有类似 /%category%/%post_id%-%postname%/ 的帖子 URL。

现在我想从/%category%/%postname%/ 之类的永久链接中删除post_id

如何在 WordPress 中执行此操作而不会出现 404 错误。 (我有一些过去的电子邮件活动,所以是旧网址。)

喜欢旧网址:

http://example.com/category/4390-new-post/

新网址:

http://example.com/category/new-post/

我在网站上有超过 70,000 个帖子。所以我无法为所有帖子添加 301 重定向。

请帮忙。

【问题讨论】:

    标签: wordpress .htaccess permalinks


    【解决方案1】:

    您需要更改永久链接 - 这是一个简单的解决方法,不涉及重定向。这是一个阅读更多内容的链接:https://codex.wordpress.org/Using_Permalinks

    在您的 WP-Admin 中,转到 Settings > Permalinks 并应用您想要的选项。

    【讨论】:

    • 感谢您的宝贵时间。我在电子邮件活动中发送了一些 url,那么那些呢。它转到 404。
    猜你喜欢
    • 2016-04-05
    • 2015-08-02
    • 2021-10-21
    • 2021-06-22
    • 1970-01-01
    • 1970-01-01
    • 2016-09-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多