Welcome! Log In Create A New Profile

Advanced

Re: try_files rewrite drops other get variables

Ian Evans
October 17, 2012 10:22PM
On 17/10/2012 10:03 PM, Edho Arief wrote:
> On Thu, Oct 18, 2012 at 8:59 AM, Edho Arief <edho@myconan.net> wrote:
>> On Thu, Oct 18, 2012 at 8:55 AM, Ian Evans <ianevans@digitalhit.com> wrote:
>>>
>>> I thought adding $args to the end of the try_files line would work but that
>>> appeared to mess it up more. Is there any way to get the try_files version
>>> to work like the old version?
>>>
>>> Been staring at this but I don't see how
>>> rewrite ^/galleries(/.*$|$) /galleries.php?mypath=$1 last; passes the path
>>> and additional GET variables, but the try_files version doesn't pass on the
>>> additional variables.
>>>
>>
>> From nginx.org/r/rewrite:
>>
>> "If a replacement string includes the new request arguments, the
>> previous request arguments are appended after them. If this is
>> undesired, putting a question mark at the end of a replacement string
>> avoids having them appended, for example:"
>
> Additionally, I do indeed add $args for my try_files for wordpress:
>
> try_files $uri $uri/ /index.php?q=$uri&$args;

I changed the try_files to:

try_files /pixcache$request_uri/index.html
/galleries.php?mypath=$mypath&$args;

and it worked. I had mistakenly added the $args without the '&'

Will take it for a sail and make sure it keeps working. :-)

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

try_files rewrite drops other get variables

Ian M. Evans October 16, 2012 02:46PM

Re: try_files rewrite drops other get variables

Ian Evans October 17, 2012 09:56PM

Re: try_files rewrite drops other get variables

Edho Arief October 17, 2012 10:00PM

Re: try_files rewrite drops other get variables

Edho Arief October 17, 2012 10:04PM

Re: try_files rewrite drops other get variables

Ian Evans October 17, 2012 10:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 239
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready