Welcome! Log In Create A New Profile

Advanced

Re: rewrite assistance

António P. P. Almeida
November 23, 2010 04:58PM
On 23 Nov 2010 21h41 WET, nginx-forum@nginx.us wrote:

> Hi all,
>
> I'm trying to add in a rewrite rule that will take this string and
> just do a redirect to / /preview.php?controllerName=channel&id=2
>
> Since the query string can vary, how would I craft my rewrite
> appropriately to do this? I've tried a few variations of the
> following, but all it does is remove the "preview.php" portion of
> the string, leaving the "?controllerName=channel&id=2" rewrite
> ^/preview.php(.*) / permanent;

Note that your saying with your regex that I want a numeric capturing
group that can have *0* characters.

Try this:

^/preview.php(?:.*)$ / permanent;

Now you're saying match anything with a non-capturing group to the end
of the line.

--- appa


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