How can I rewrite an url with GET parameters ?

Valentin V. Bartenev vbart at nginx.com
Wed Mar 26 16:24:16 UTC 2014


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



More information about the nginx mailing list