We were running on apache previously and used the below code to redirect/replace one of our query parameters.
RewriteCond %{QUERY_STRING} ^limit=(.*)$ [NC]
RewriteRule ^ %{REQUEST_URI}?product_list_limit=%1 [L,R=301]
This would successfully redirect the below URL
www.example.com/clothing.html?limit=all
TO
www.example.com/clothing.html?product_list_limit=all
I have used a htaccess redirect convertor that has produced the below. This doesn't work
location ~ / {
if ($query_string ~* "^limit=(.*)$"){
rewrite ^(.*)$ /$request_uri?product_list_limit=%1 redirect;
}
}
Any help appreciated
Thanks