Welcome! Log In Create A New Profile

Advanced

Re: rewrite assistance

November 24, 2010 06:30AM
On Tue, Nov 23, 2010 at 11:42:38PM -0500, daveyfx wrote:

> Francis Daly Wrote:
> -------------------------------------------------------
>
> > Assuming that this sentence describes your wish:
> >
> > location = /preview.php {
> > rewrite ^ /? permanent;
> > }
> >
> > (untested!) should probably Just Work.
> >
> > If you *do* want to vary based on the query string
> > (?-bit), the manual
> > has an example.
> >
> > Good luck,
> >
> > f
> > --
> > Francis Daly francis@daoine.org
>
> Francis,
>
> Spot on. That seems to have done the trick. Out of my own desire to
> learn, is there a way to do the same thing without using the location
> directive, and just merely using a rewrite statement?

You can place the rewrite on server level, but it's better to use
the location, because otherwise nginx will run regex "^/preview\.php$" for
every request. Testing "location = /preview.php" is faster.


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

rewrite assistance

daveyfx November 23, 2010 04:41PM

Re: rewrite assistance

António P. P. Almeida November 23, 2010 04:58PM

Re: rewrite assistance

daveyfx November 23, 2010 07:22PM

Re: rewrite assistance

Francis Daly November 23, 2010 07:32PM

Re: rewrite assistance

daveyfx November 23, 2010 11:42PM

Re: rewrite assistance

Francis Daly November 24, 2010 05:48AM

Re: rewrite assistance

Igor Sysoev November 24, 2010 06:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 70
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