DONE:
# NEW 20040713 /images and /banners are local
# CHANGED 20060123 added feeds-local
# CHANGED 20060216 added css & js
# CHANGED 20080324 blog (new) is local
# 20080701 For-pay demo is local
if ( $uri =~ m#^/(images|banners|feeds-local|css|js|blog|w3c)/# ) {
$uri = "LOCAL:$uri";
}
# CHANGED 20040707 handle "REDIRECT:" special case
# CHANGED 20040713 handle "LOCAL:" special case
if ( $uri =~ m/^(REDIRECT|LOCAL):/ ) {
$redir = $uri;
}
else {
$redir = "backend.neighborhoodlink.com$uri";
#
# Mangle the query string if necessary. Query string sometimes
# contains MIME-escaped characters, e.g. the "mail this page to a friend"
# link gives a query string of "location=%2Fpublic%2Fmain2.html&qry=etc"
# and we had to unescape those in the Rewrite rule (see httpd.conf) in order
# to avoid "%2" being read as a backreference. So, now we have to escape
# the little bastards again. Capisci?
#
if ( $qs =~ m/^location=(.*)&qry=(.*)$/ ) {
$qs = "location="
. uri_escape( $1, "&=" ) . "&qry="
. uri_escape( $2, "&=" );
}
$redir .= "?$qs" if ($qs);
}
REALLYDONE:
&debug("final redirection: $redir");
print "$redir\n";
&logtest("$orig $redir");