Rewrite URL to only show value of $_GET argument

wishmaster artemrts at ukr.net
Mon Sep 9 13:05:18 UTC 2013



 --- Original message ---
From: "Andrew Martin" <andrew.s.martin at 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/ index.php;
> 
> 
> location / {
> rewrite ^/index\.php?title=(.*)$ http://mysite.com/$arg_title redirect;
> 
  May be something like this :
  rewrite ^/index\.php.* http://mysite.com/$arg_title redirect;
I think nginx "know" about all arguments in your request, therefore simple specify needed argument's name in the second part of rewrite rule.

 



More information about the nginx mailing list