if ($request_uri ~ "^/catalog/search/\?q=(.*)") {
return 301 /catalog/?search=$1;
}
location = /catalog/search/ {
if ($args ~ "^q=(.*)") {
return 301 /catalog/?search=$1;
}
}
location = /catalog/search/ {
return 301 /catalog/?search=$arg_q;
}