【问题标题】:How to redirect /post-name to /post/post-name如何将 /post-name 重定向到 /post/post-name
【发布时间】:2016-02-25 19:23:53
【问题描述】:

我有一个 wordpress 网站。我想将我的 /post-name 网址重定向到 /post/post-name。当我尝试这段代码时,它将结束无限重定向。我在谷歌搜索,但我找不到任何东西。如何将我的 /post-name 网址重定向到 /post/post-name ?

谢谢...

重写规则 ^(.*)(/)$ /post/$1/ [R=301,L]

重写规则 ^en/(.*)(/?)$ /en/post/$1/ [R=301,L]

【问题讨论】:

    标签: .htaccess redirect url-rewriting rewrite url-redirection


    【解决方案1】:

    嗯,

    我找到了自己问题的答案 :) 此代码正在运行。

    重定向匹配 301 ^/([^/]+)/$ http://websiteurl/post/$1

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-19
      • 2014-07-05
      • 2011-05-31
      • 2017-03-23
      • 1970-01-01
      • 2017-10-28
      相关资源
      最近更新 更多