Let’s say the marketing department can’t make up its mind on which domain name to use. It’s between ultimatefoo.com or uberfoo.com.
So you build a website and point both domains to the same server. Easy.
Then one day, they say, hey, let’s go with uberfoo.com cuz it’s shorter and “uber” is the buzz word for the moment. Now they want you to redirect customers who go to ultimatefoo.com to uberfoo.com just so it’s consistent.
Then Click Add Forwarding
Fill in the Forward To section:
Simple enough… if you have IT access to the domain. But what if you didn’t?
Suppose you wanted to do it strictly from Apache. Here’s how.
Open the .conf file. Its location is machine-dependent. I found mine at /etc/apache2/sites-available/25-http.conf
Now you’ll need to modify it to create two <VirtualHost> sections. One should already be there.
For the existing one, modify the ServerName if you haven’t done so already to uberfoo.com:
<VirtualHost *:80> ServerName uberfoo.com DocumentRoot "/var/www" ... </VirtualHost>
Next create a second VirtualHost that redirects to it like so
<VirtualHost *:80> ServerName ultimatefoo.com Redirect "/" "http://uberfoo.com" </VirtualHost>
Now you don’t even have to bother the IT guy in charge of domains 🙂