DreamHost Remap Sub-Directory

In this article, I will show you how to do remapping of a URL to the sub directory. To understand the remapping process, you first need to understand the mapping process. Let’s understand mapping with an example.

Any web hosting company uses web server. Most widely used web server is apache web server. When somebody visits your website the pages and images are served from one of the directories on the server. On web server, there are many directories. Each web site is assigned a separate directory. When anybody access your website, the pages and images are served from assigned directory. The assignment of directory to the website is called mapping.

The main assigned directory to the website is called document root or a root directory of the website. Different web hosting companies has different directory structure for document root. If you are on the web hosting provide which uses cPanel as their control panel then the document root for such provider will be “public_html” folder. DreamHost uses domain name as document root. So it is easy to manage the directory structure. If example.com is hosted on DreamHost then the document root for example.com will be /home/username/example.com . In the path username is your username.

When somebody visits example.com, the file pages are served from example.com directory. When someone access http://example.com/images then data from /home/username/example.com/images are served.

What is Remapping of Sub Directory?

Now you understand what mapping is. Remapping is the process of changing mapping between URL and the assigned directory. So in the above example of images folder, if you want the web server to serve data from /home/username/example.com/data/images folder instead of /home/username/example.com/images folder then you will have to do the remapping of the URL http://example.com/images to /home/username/example.com/data/images.

Why Remapping is Needed?

I don’t think one need to use the remapping frequently. Remapping is used in extreme situations.

If you did not organized the data when you first created the website then you might need to do remapping. It is always good to keep the directory structure organized. If you didn’t take of the path selection when you first created images and videos for your website then you might need to do remapping in the future.

Second reason for doing remapping is that you want to do the sharing. For example, if you have two different developers, one is for creating images and another is for creating videos then you create two different directories for both of them. Then you do remapping of images and video folder to respective directories. Now when the developers directly upload the data to their directory, they will be accessible by the website.

DreamHost Remap Sub Directory Video

You can watch the following video to understand the remapping procedure.

Remap Sub Directory on DreamHost

At DreamHost, it is very easy to remap the sub directory. You need to follow these steps in order to remap the URL to directory.

1) First login to DreamHost panel with your username and password.

2) Click on Domains section. Then click on Remap Sub-Dir link.

Remap Sub directory

3) On this page select the domain on which you want to remap the directory. Also enter the path name to complete the URL.

DreamHost Remap Sub Dir URL

4) Next you need to give the new sub directory name in the mapping procedure. You can also select the directory from other user of the same account. When the new directory name is given, click on “Remap this sub-directory!” button.

Remap Sub Dir New Path

5) Once the mapping is complete, you will get success message. You will also see the option to edit or delete. You can either change the setting of mapping or completely remove the mapping.

Remap success and edit button

Now you know how to remap the sub directory in your DreamHost account. Enjoy the content from new directory.