【问题标题】:Need help using mod_rewrite to redirect some URL's based on query string需要帮助使用 mod_rewrite 根据查询字符串重定向某些 URL
【发布时间】:2012-08-01 10:53:19
【问题描述】:

我有一个 WordPress 网站,需要根据查询字符串重定向一些 URL。

链接是/?product_brand=brandname

我需要将它们全部重定向到/?product_bisbrand=brandname

有人能指点我正确的方向吗?

【问题讨论】:

    标签: wordpress .htaccess mod-rewrite redirect


    【解决方案1】:

    尝试将其放在文档根目录的 htaccess 文件中的适当位置:

    RewriteEngine On
    RewriteCond %{QUERY_STRING} (.*)product_brand=([^&]+)&?(.*)
    RewriteRule ^(.*)$ /$1?%1product_bisbrand=%2&%3 [R=301,L]
    

    【讨论】:

      猜你喜欢
      • 2012-11-29
      • 1970-01-01
      • 2011-02-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-02
      • 2011-01-13
      • 1970-01-01
      相关资源
      最近更新 更多