【问题标题】:Redirect all tag pages in WordPress using .htaccess使用 .htaccess 重定向 WordPress 中的所有标签页
【发布时间】:2016-05-28 10:08:59
【问题描述】:

我正在尝试使用 .htaccess 将我的 wordpress 网站中的所有标签页面重定向到我的博客页面。这是我在 .htaccess 中的代码 -

Redirect 301 ^tag/(.*) /blog/

不幸的是它不起作用,有什么办法可以解决它?

【问题讨论】:

    标签: wordpress .htaccess


    【解决方案1】:

    重定向指令不使用正则表达式,您可以使用 RedirectMatch 代替

    RedirectMatch 301 ^/tag/(.*) /blog/
    

    或者

    Redirect 301 /tag/ /blog/
    

    【讨论】:

      【解决方案2】:

      试试看。

      RedirectMatch 301 ^/tag/$ /blog/
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-03-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-11
        • 2015-04-05
        • 1970-01-01
        相关资源
        最近更新 更多