swerc

anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

commit f4ffef44e58b4ff47381f0f89de8b65306e7e14d
parent b8b0302c5529bfec79ed8731419011537ddbc374
Author: uriel@suckless.org <unknown>
Date:   Sat, 12 Jul 2008 07:34:43 +0200

Some redirect improvements (add the domain name to match string)
Diffstat:
Mbin/controller.rc | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/controller.rc b/bin/controller.rc @@ -152,7 +152,7 @@ fn dprint { } if(! ~ $#debug 0) - dprint $SERVER_NAME^'/'^$REQUEST_URI^' - '^$"HTTP_USER_AGENT + dprint $SERVER_NAME^$REQUEST_URI^' - '^$"HTTP_USER_AGENT if (! ~ $args '') { @@ -190,10 +190,10 @@ Location: '^$1^' if (~ $#redirectPermanent 1) perm_redirect $"redirectPermanent -if not if (~ $#redirectPermanent 2) { +if not if (~ $#redirectPermanent 2 && {echo $SERVER_NAME^$REQUEST_URI|grep -s $redirectPermanent(1) }) { # Experimental regexp sub-based redirect, probably should find a nicer interface # For now only used at sites/harmful.cat-v.org/software/OO_programming/_config - to=`{echo $REQUEST_URI|sed 's|'^$redirectPermanent(1)^'|'^$redirectPermanent(2)^'|'} + to=`{echo $SERVER_NAME^$REQUEST_URI|sed 's|'^$redirectPermanent(1)^'|'^$redirectPermanent(2)^'|'} if(! ~ $to $REQUEST_URI) perm_redirect $to }