It doesn't require recompiling Aolserver, or anything really that complicated, and lets you share an IP address among multiple servers. You don't even need another instance of Aolserver. Just the main server needs to have OpenACS on it.
The only downside is that you get the port numbers in the address.
Try it with http://rubick.com or http://www.rubick.com
You should be redirected to http://rubick.com:8002
Here's how it works:
Copy this inside it:
ad_page_contract {
redirect
@author Jade Rubick
@creation-date 2003-04-24
Helpful .vuh example at
http://www.arsdigita.com/bboard/q-and-a-fetch-msg?msg_id=000JTn
} {
}
set path [ad_return_url]
set page_loc "http://rubick.com:8002$path"
set page "<html><title>Redirecting to Rubick</title><body>Moving to Rubick.com site<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"1;URL=$page_loc\"></html>"
ns_write $page
Substitute your port in for 8002.
One issue I had was getting www.rubick.com to work as well as rubick.com. The reason is you can't have two sites going to the same directory. To get around this, you'll have to create a redirect and redirect2 directory.
I wanted to use ad_returnredirect, but there is a bug in IE that prevents me from using it. Unfortunately, this means I have to slow down all users..