Quantcast
Channel: How to redirect with query string in Nginx - Server Fault
Viewing all articles
Browse latest Browse all 2

How to redirect with query string in Nginx

$
0
0

I would like to redirect:

something.com/search?keywords='value'

to

something.com/search?q='value'

Here is my Nginx config:

location ~ /search {       if ($args ~* "keywords=(.*)") {            rewrite ^.*$ /search?q=$arg_keywords permanent;        }    }

But the q parameter is empty on redirection.

What is wrong?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images