Pointing Multiple Domains to the Same Alternate Domain Folder
Sometimes you want to simply point another domain to an alternate domain's folder. This article will show you how to do just that.
Example: You have mt-example.com as a primary and alt-example.com as an alternate. You want alt-example.com to serve the same content as mt-example.com.
DETAILS:
On (ss) Shared-Servers
1) Create a .htaccess file (if one doesn't exist) in the webroot (/var/www/html/) folder and add the following line to it:
Options +FollowSymLinks
Making sure to include the capitalization.
2) Log into your server via SSH (see our article (ss) Enabling SSH Access) and do a:
cd /var/www/html
ln -s mt-example.com alt-example.com
and hit enter, this should create a symlink that points requests for alt-example.com to mt-example.com. If SSH hasn't been enabled on your account you can request it through the support request system.
On (gs) Grid-Services
1) Add the domains you'd like to use (alt-example.com in this example) as alternate domains in the AccountCenter.
2) Log into your (gs) via SSH, move into the domains directory and delete the folders for alt-example.com with these commands:
cd domains
rm -rf alt-example.comIf you need help enabling SSH for the 'serveradmin' user please follow our article Connecting via SSH to your (gs) Grid-Service.
3) Create a symlink named 'alt-example.com that points at the mt-example.com folder with this command:
ln -s mt-example.com alt-example.com
NOTES:
NOTES:
- This article requires SSH to be turned on. If you do not currently have it turned on, please follow our articles Connecting via SSH to your (gs) Grid-Service or (ss) Enabling SSH Access to enable SSH for your admin user.
- DO NOT try and remove the symlink via FTP, as it will follow the link to your real folder and delete all of your data. Use SSH to remove your symlinks via this command:
rm -f alt-example.com - It's important to mention you can also redirect a domain using a .htaccess file. For more details please read:
Revisions:
07-20-2009: Minor Fixes
Fields marked with an asterisk(*) are required. Comment on this article