【问题标题】:Redirect wordpress specific attachment_id URL with question mark使用问号重定向 wordpress 特定的附件 ID URL
【发布时间】:2017-02-15 08:51:03
【问题描述】:

我检查了所有提出的问题,但没有解决我的问题。

有一个 URL https://www.example.com/blog/?attachment_id=3392 重定向到 404 未找到页面。例如,我有许多需要重定向到 https://www.example.com/blog/ 的附件 ID URL。如何使用 htaccess 重定向来做到这一点?

提前谢谢你

【问题讨论】:

    标签: wordpress .htaccess


    【解决方案1】:

    试试:

    RewriteRule ^(.*)?attachment_id(.*)$ http://www.example.com/blog/ [L,R=301]
    

    【讨论】:

    • 不幸的是,这没有帮助。当我尝试访问 example.com/blog/?attachment_id=3392 时仍然是 404
    • 您可以在 404 模板页面中创建重定向。如果它与该字符串联系,则创建一个重定向到 /blog
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-01
    • 2016-09-15
    • 2017-06-12
    相关资源
    最近更新 更多