Re: Rewrite URL to only show value of $_GET argument

2013-09-19 Thread Andrew Martin
Steve, Thanks for the suggestion. How would this additional check change the solution I proposed on 9/16? It looks like it would prevent the rewrite from occurring if other arguments (instead of title) were present? Thanks again, Andrew On Sun, Sep 8, 2013 at 11:31 PM, Steve Holdoway

Re: Re[2]: Rewrite URL to only show value of $_GET argument

2013-09-15 Thread Andrew Martin
Francis, I ended up coming up with this solution: map $request_uri $request_basename { ~/(?captured_request_basename[^/?]*)(?:\?|$) $captured_request_basename; } server [ try_files $uri $uri/ @rewrite; location ~ [^/]\.php(/|$) { fastcgi_split_path_info

Re: Re[2]: Rewrite URL to only show value of $_GET argument

2013-09-11 Thread Andrew Martin
Francis, Using the similar statement try_files $uri $uri/ /index.php;, if I visit this URL: http://mysite.com/index.php?title=my_test_page then the URL is rewritten to this, but it just loads the contents of index.php (without the title variable): http://mysite.com/my_test_page What it shows

Re: Re[2]: Rewrite URL to only show value of $_GET argument

2013-09-11 Thread Francis Daly
On Wed, Sep 11, 2013 at 08:32:09AM -0500, Andrew Martin wrote: Hi there, Using the similar statement try_files $uri $uri/ /index.php;, if I visit this URL: http://mysite.com/index.php?title=my_test_page then the URL is rewritten to this, but it just loads the contents of index.php (without

Re: Re[2]: Rewrite URL to only show value of $_GET argument

2013-09-10 Thread Francis Daly
On Mon, Sep 09, 2013 at 08:23:36AM -0500, Andrew Martin wrote: Hi there, If I use this line: rewrite ^/index\.php(.*)$ http://mysite.com/$arg_title? redirect; /index.php?title=my_test_page redirects to /my_test_page That's what you asked for initially; I'd probably spell it as location

Re: Rewrite URL to only show value of $_GET argument

2013-09-09 Thread mex
rewrite ^/index\.php?title=(.*)$ http://www.mysite.com/$1 redirect; this doesnt work? what is $1 then in the redirected request? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,242676,242678#msg-242678 ___ nginx mailing list nginx@nginx.org

Re: Rewrite URL to only show value of $_GET argument

2013-09-09 Thread Andrew Martin
Thanks for the suggestions. I was not able to get $arg_title to work. Here is the relevant section of my nginx config: server_name mysite.com; try_files $uri $uri/ index.php; location / { rewrite ^/index\.php?title=(.*)$ http://mysite.com/$arg_title

Re[2]: Rewrite URL to only show value of $_GET argument

2013-09-09 Thread wishmaster
--- Original message --- From: Andrew Martin andrew.s.mar...@gmail.com Date: 9 September 2013, 15:53:01 Thanks for the suggestions. I was not able to get $arg_title to work. Here is the relevant section of my nginx config:        server_name mysite.com; try_files $uri $uri/

Re: Re[2]: Rewrite URL to only show value of $_GET argument

2013-09-09 Thread Andrew Martin
If I use this line: rewrite ^/index\.php(.*)$ http://mysite.com/$arg_title? redirect; /index.php?title=my_test_page redirects to /my_test_page This is the URL I am looking for, but it still results in a 404, with this displayed in the log: [error] 16077#0: *156649 FastCGI sent in stderr: Primary

Rewrite URL to only show value of $_GET argument

2013-09-08 Thread Andrew Martin
Hello, I have read through the nginx rewrite documentation and looked at various examples, but can't figure out how to create a rewrite rule for the following (if it is possible). I'd like to rewrite the URL of a php file with a $_GET argument and replace it with just the value of the $_GET