Welcome! Log In Create A New Profile

Advanced

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

Francis Daly
September 11, 2013 08:44AM
On Tue, Sep 10, 2013 at 09:07:46PM -0500, Andrew Martin wrote:

Hi there,

> Would it be possible to only redirect if the title $_GET variable is
> present?

Yes.

Use something like

if ($arg_title != "") {
return 302 http://mysite.com/$arg_title;
}

inside the "location = /index.php" block, and then continue with whatever
should happen if $arg_title is empty.

> 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?

I suspect that "try_files $uri /$uri /index.php;" might be enough for
what you ask for here; if it isn't, then a description of what you do,
what you see, and what you expect to see, will probably make it easier
to understand where the problem is. (Your fastcgi-related configuration,
and the php code itself, will determine whether it is enough.)

If you search for nginx + your-php-application, do you see any
documentation on how to create SEF URLs? It may be easier than me
guessing here.

f
--
Francis Daly francis@daoine.org

_______________________________________________
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: 104
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