oops (was: Any Apache mod_rewrite experts out there?)

From: Joe Hourcle <oneiros_at_nyob>
Date: Mon, 18 May 2015 09:59:11 -0400
To: CODE4LIB_at_LISTSERV.ND.EDU
On Mon, 18 May 2015, Joe Hourcle wrote:


>  RewriteRule ^(.*)-(.*)ezproxy.switchinc.org/(.*) $1.$2ezproxy.switchinc.org/$3 [N]

I wasn't thinking ... RewriteRule doesn't operate on the full URL, only on 
the non-host portion.  You might need to do strange things w/ RewriteCond 
and RewriteRule instead:

   RewriteCond %{HTTP_HOST} ^(.*)-(.*)ezproxy.switchinc.org
   RewriteRule ^(.*) http://%1.%2ezproxy.switchinc.org/$1 [N]

The %1 and %2 come from the captures in RewriteCond, while the $1 comes 
from RewriteRule.

-Joe
Received on Mon May 18 2015 - 10:02:45 EDT