Welcome! Log In Create A New Profile

Advanced

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

Andrew Martin
September 09, 2013 09:26AM
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 script unknown"
while reading response header from upstream, client xxx.xxx.xxx.xxx,
server: mysite.com, request: "GET /my_test_page HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "mysite.com"

Thanks,

Andrew


On Mon, Sep 9, 2013 at 8:05 AM, wishmaster <artemrts@ukr.net> wrote:

>
>
> --- Original message ---
> From: "Andrew Martin" <andrew.s.martin@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.
>
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rewrite URL to only show value of $_GET argument

Andrew Martin September 09, 2013 12:04AM

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

mex September 09, 2013 02:58AM

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

edogawaconan September 09, 2013 05:00AM

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

Andrew Martin September 09, 2013 08:54AM

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

artem September 09, 2013 09:06AM

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

Andrew Martin September 09, 2013 09:26AM

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

Francis Daly September 10, 2013 12:48PM

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

Andrew Martin September 10, 2013 10:10PM

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

Francis Daly September 11, 2013 08:44AM

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

Andrew Martin September 11, 2013 09:34AM

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

Francis Daly September 11, 2013 10:32AM

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

Andrew Martin September 16, 2013 06:50AM

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

GreenGecko September 19, 2013 07:54PM

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

Andrew Martin September 20, 2013 12:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 105
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready