All files from this thread

File Name File Size   Posted by Date  
patch.try_files.746 326 bytes open | download Igor Sysoev 03/30/2009 Read message
March 30, 2009 11:48AM
On Mon, Mar 30, 2009 at 06:14:25PM +0300, Reinis Rozitis wrote:

> >The attached patch fixes the bug.
>
> It fixed the garbage part then again QUERY_STRING is now empty at all.. Or
> is this expected?
>
>
> In short what I try to archieve is this - if you have:
>
> location /tmp {
> try_files $uri /index.php;
> }
>
> And open something like http://myserver/tmp/somecategory/another/?id=234
> php still gets 'id' as normal GET variable..

If you want to preserve query_string, then you should use

try_files $uri /index.php?$args;

> The rewrite or error_page alternative would be:
>
> rewrite ^/tmp/(.*)$ / last;
>
> location /tmp/ {
> error_page 404 = /index.php;
> }
>
>
>
>
> I somehow see this conflicting if you specify something like this in the
> config
>
> location /tmp {
> try_files $uri /index.php?q=$request_uri;
> }
>
> Then again it gets messy if you want to split the query_string on php side
> and assign all the variables.. Besides try_files looks way more superior
> than both previous approaches..


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

try_files and GET variables

Reinis Rozitis March 30, 2009 09:47AM

Re: try_files and GET variables Attachments

Igor Sysoev March 30, 2009 10:17AM

Re: try_files and GET variables

Reinis Rozitis March 30, 2009 11:14AM

Re: try_files and GET variables

Igor Sysoev March 30, 2009 11:48AM

Re: try_files and GET variables

Reinis Rozitis March 30, 2009 12:33PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 205
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