【问题标题】:Simple htaccess redirect without query string没有查询字符串的简单 htaccess 重定向
【发布时间】:2013-06-10 13:23:30
【问题描述】:

我想重定向以下链接 http://www.example.com/full-tang-polished-samurai-katana-sword.htmlhttp://www.example.com/final-fantasy-advent-children-cloud-buster-sword.html

我使用了几种方法,包括

Redirect 301 /full-tang-polished-samurai-katana-sword.html http://www.example.com/final-fantasy-advent-children-cloud-buster-sword.html

哪个产生

http://www.example.com/final-fantasy-advent-children-cloud-buster-sword.html?full-tang-polished-samurai-katana-sword.html

我无法处理这个查询字符串

?full-tang-polished-samurai-katana-sword.html

请帮帮我

【问题讨论】:

    标签: .htaccess redirect query-string


    【解决方案1】:

    终于解决了这个问题,代码如下

    RedirectMatch 301 ^/full-tang-polished-samurai-katana-sword.html$  http://www.example.com/final-fantasy-advent-children-cloud-buster-sword.html
    RewriteCond %{QUERY_STRING} ^full-tang-polished-samurai-katana-sword.html$
    RewriteRule ^(.*)$ http://www.example.com/final-fantasy-advent-children-cloud-buster-sword.html? [R=301,L]
    

    【讨论】:

      猜你喜欢
      • 2015-03-31
      • 1970-01-01
      • 2016-01-18
      • 1970-01-01
      • 1970-01-01
      • 2014-07-08
      • 1970-01-01
      • 2017-04-13
      相关资源
      最近更新 更多