How can I rewrite an url with GET parameters?

Hello,

How can I have this : http://example.org/en/somepage.php

For : http://example.org/somepage.php?locale=en

( locale=en is always present)

Thanks.

Posted at Nginx Forum:

On Wednesday 26 March 2014 12:09:27 skyice wrote:

Hello,

How can I have this : http://example.org/en/somepage.php

For : http://example.org/somepage.php?locale=en

( locale=en is always present)

Thanks.

location =/somepage.php {
rewrite ^ /$arg_locale/somepage.php? last;
}

wbr, Valentin V. Bartenev

Ok thanks but somepage.php is just an examplle and I want this for all
pages
of my website :confused:

Posted at Nginx Forum: