Nginx Rewrite

How can i turn this into a rewrite i have include what i have tried

for example you have www.example.com/test/c_index.shtml

you click a the change language button and the url changes to
www.example/com/test/c_index.shtml?change_lang

so i would like to rewrite that to www.example.com/test/e_index.shtml

I have tried

rewrite /test/c_(.*)?change_lang /test/e_$1 redirect;

but that doesnt work

Any help would be much appreciated

Posted at Nginx Forum:

Why did you escape the question mark?

B. R.

On Thu, Feb 05, 2015 at 12:16:27PM -0500, ntamblyn wrote:

Hi there,

How can i turn this into a rewrite i have include what i have tried

“rewrite” matches a request uri, the same as “location” does. This does
not include the query string.

I have tried

rewrite /test/c_(.*)?change_lang /test/e_$1 redirect;

but that doesnt work

If “rewrite” is the right tool, a way to use it here is

if ($args = “change_lang”) {
rewrite ^/test/c_(.*) /test/e_$1? redirect;
}

f

Francis D. [email protected]