Welcome! Log In Create A New Profile

Advanced

a regex for rewrite

September 04, 2013 06:54PM
I have a set of rewrites as

rewrite ^/(.*)/(.*)/(.*)\.(.*) /script.php?a=$1&b=$2&c=$3&ext=$4 last;
rewrite ^/(.*)/(.*)\.(.*) /script.php?a=$1&b=$2&ext=$3 last;
rewrite ^/(.*)\.(.*) /script.php?a=$1&ext=$2 last;
rewrite ^/(.*)/(.*)/(.*)/(.*) /script.php?a=$1&b=$2&c=$3&d=$4 last;
rewrite ^/(.*)/(.*)/(.*) /script.php?a=$1&b=$2&c=$3 last;
rewrite ^/(.*)/(.*) /script.php?a=$1&b=$2 last;

How can I use one single rewrite rule to match all possible choices?
SubjectAuthorPosted

a regex for rewrite

etraderSeptember 04, 2013 06:54PM

Re: a regex for rewrite

Francis DalySeptember 04, 2013 08:06PM

Re: a regex for rewrite

Francis DalySeptember 04, 2013 08:12PM

Re: a regex for rewrite

etraderSeptember 05, 2013 11:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 76
Record Number of Users: 5 on December 17, 2014
Record Number of Guests: 154 on December 17, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready