Welcome! Log In Create A New Profile

Advanced

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

Andrew Martin
September 10, 2013 10:10PM
Francis,


On Tue, Sep 10, 2013 at 11:46 AM, Francis Daly <francis@daoine.org> wrote:

> 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 = /index.php {
> return 302 http://mysite.com/$arg_title;
> }
>
> to make it clear what exactly is happening, and which might point out
> the parts you didn't specify:
>
> what should happen if I ask for any of
>
> /index.php?something=else
> /index.php?title=my_test_page&something=other
> /index.php
>
> ? With the above code, the second will possibly redirect the way you want,
> and the others probably won't.
>
Would it be possible to only redirect if the title $_GET variable is
present?

>
> Also, what should happen when I ask for
>
> /my_test_page
>
> ? I will do that immediately after you redirect me there.
>
> If you can describe the complete behaviour you want, the nginx
> configuration needed to achieve it may become clear.
>
Thanks for clarifying this. The complete behavior I'm looking for is just to
create SEF URLs for pages on the site by hiding the index.php?title= part
of the URL. Thus, visiting /my_test_page in your browser would internally
load the index.php?title=my_test_page URL but display the SEF URL to
the user. How can I achieve this behavior?

Thanks,

Andrew

>
> f
> --
> Francis Daly francis@daoine.org
>
> _______________________________________________
> 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: 117
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready