Print

Print


My organization is changing proxy servers from WAM to EZproxy, and we would like to give staff time to change over their URLs before we make the switch. I would like to set up forwarding so the links using the new proxy get redirected to the old proxy. I'm planning on using apache's mod_rewrite to do this.

Basically, this mod rewrite rule needs to do three things:
1) Change the part of the domain name (not the file path) that reads "ezproxy.switchinc.org" to our old domain "topcat.switchinc.org"
2) Append the prefix "0-" in front of the domain name
3) Transform dashes in the domain name to periods. 

Could anyone provide me with some assistance? I am sure this takes maybe 10 lines of code from a mod_rewrite expert, but it has taken me several weeks to the first two objectives done, and all of my google fu is failing me for objective three. Below is what I have: 

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)ezproxy.switchinc.org [NC]
RewriteRule ^(.*) %{HTTP_HOST}/$1 [DPI]
RewriteRule ^(.*)ezproxy.switchinc.org/(.*) http://0-$1topcat.switchinc.org/$3 [L]

Thanks,
Karl Holten
Systems Integration Specialist
SWITCH Inc
414-382-6711