How do I use symlinks to redirect my site?

Browse by products and services

  • Applies to: Grid
    • Difficulty: Medium
    • Time Needed: 20
    • Tools Required: SSH


This article will show you how to make the content displaying for appear when visiting A symlink, short for symbolic link, is one of the best ways to do this.

Before you start

Be sure to have the following:

This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.


Symlink as a mirror

These instructions will create a file system link from one folder to another, allowing you to point multiple domains to the same alternate (or primary) domain folder. Essentially, this creates a mirror of your content from to The browser will display in the address bar.

If you want the URL to change to the target domain, you should use a 301 Redirect instead.

  1. Connect to your server via SSH.
  2. Move into the domains directory.
    cd domains
  3. Delete any existing empty folders for your alternate domains. DO NOT delete the folder for the domain that has the content.


    Use the following command only for empty folders. This command will delete the specified folder, along with all of its contents. If you're more comfortable with FTP, you can also perform this step using your favorite FTP client.

    rm -rf
  4. Create the symlink for with the target of Be sure to replace the domain names in the example with your own domain names.
    ln -s

    Here's the command breakdown:

    • ln - Makes a link.
    • -s - Designates a symlink.
    • - Your target folder. This is the one that has the content.
    • - Your alias. This is the new alternate domain that currently has no content.

You should now be able to visit and see your website content that is also displayed on


DO NOT remove the symlink via FTP. FTP will actually follow the link to your real folder and delete all of your data. Instead use SSH to remove your symlink with this command:

unlink -f

Point your sub-domain to a sub-directory on this domain

The example below will create a new sub-domain on a Grid named that will display content from the already existing sub-directory named sub located at

These steps will NOT mirror or copy the content. All traffic to the new sub-domain will in fact be generated on the previous domain. Keep in mind that any changes made to will be immediately available at your new sub-domain.


  • You will need SSH access to complete the steps outlined in this article. See here for more details.
  1. Connect to your Grid using SSH and go to your domains directory:
    cd /home/00000/domains/
  2. Create your sub-domain directory and navigate inside the directory:


    If your sub-domain already exists, it will have to be deleted first using the rm command. Make sure you have backed up any files first before recursively deleting any directories on your service.

    mkdir && cd
  3. Now, create a symbolic link that will use your already existing sub-directory on your other domain:
    ln -s /home/00000/domains/ html
  4. Add the Options +FollowSymLinks directive to a newly created htaccess file using the echo command:
    echo 'Options +FollowSymLinks' > .htaccess