【发布时间】:2019-01-03 19:22:01
【问题描述】:
我们之前在 apache 上运行并使用以下代码重定向/替换我们的查询参数之一。
RewriteCond %{QUERY_STRING} ^limit=(.*)$ [NC]
RewriteRule ^ %{REQUEST_URI}?product_list_limit=%1 [L,R=301]
这将成功重定向以下 URL
www.example.com/clothing.html?limit=all
到
www.example.com/clothing.html?product_list_limit=all
我使用了一个生成以下内容的 htaccess 重定向转换器。这不起作用
location ~ / {
if ($query_string ~* "^limit=(.*)$"){
rewrite ^(.*)$ /$request_uri?product_list_limit=%1 redirect;
}
}
任何帮助表示赞赏
谢谢
【问题讨论】: