Domain handling in cPanel is easy, and everyone can do the necessary actions. You can add an addon domain; create subdomains, aliases or redirects with just a few clicks. In this article I will show you how to do these tasks.
Adding and modifying Addon Domains in cPanel
Addon domains are additional domain names that can be added as subdomains of the original domain name. They can be used to serve more domain names from the same web hosting account.
To add a new addon domain is cPanel just simply click on Addon Domain link on the main screen of the software. Enter your new domain name without www or http, like newdomain.com. The system will automatically fill in the subdomain and document root text fields, it is recommended not to modify the logic auto fill values.
If you want to create an FTP account for the newly added domain name, check Create an FTP account associated with this Addon Domain. If you check it, 3 more text fields appear which allow you to set the FTP user name and password.
Finally, press Add Domain button so the addon domain can be added to your cPanel account. This addon domain subpage will list all of your addon domains where you can edit or delete them.
If you want to modify an addon domain in cPanel, just go to Addon domains subpage and select the desired domain name. To change the document root, click on pencil icon next to current root path. You can edit the root in a popup window, where you should click on Change button to save the changes.
On this interface you can set or modify the redirection of an addon domain too. Just click on Manage redirection link in the related domain’s row and a new window will appear. Here you can set a new or modify an already exist redirection by changing the source url. To save the changes, you should click on the Save button.
Adding and modifying Subdomains in cPanel
A subdomain is the next level in DNS (Domain Name System) and it is always under the main domain name. For instance, if you have a mysiteurl.com domain name, news.mysiteurl.com is a subdomain of it, and surprisingly, the www.mysiteurl.com is a subdomain of mysiteurl.com domain name.
You can add subdomains in cPanel very easily; you just need to click on Subdomains link at main panel of the software. By clicking on it, you will be redirected to a new screen where you should enter the name of the subdomain, choose the related domain name from a dropdown menu and set the document root, where you can find the auto filled default value. Finally, click on Create button.
On the same interface where you can add new subdomains, you can also see your subdomains that already exist. To change a subdomain’s document root, you should click on pencil icon next to current root. A new popup window appears where you can modify the root. You can save the changes by clicking on Change button or discard them with Cancel button.
At the end of each subdomain’s row, you can see a Manage redirection link along with another pencil icon. To set or modify the redirection, you should click on that link which opens a new window. In the new window you should enter the redirect url and click on the Save button to finalize it. You can discard the changes and go back to previous screen by clicking on Disable Redirection button.
To remove a Subdomain you should click on Remove link or on the trash icon in the same row. By clicking on any of them, you will be redirected to a deletion subpage. The system will show a notification, asking you if you are sure that you want to permanently remove the desired subdomain. If you click on Delete Subdomain button, your subdomain will be removed permanently, if you click on Cancel, you will be redirected to the previous screen.
Adding and modifying Aliases in cPanel
Aliases are domain names which can be used as alternatives of your domain name. For example, you can set that people typing the myaliasdomain.com domain name arrive to your original mydomain.com.
To set aliases in cPanel, it is important to make the same measures as you should do with adding a new domain name. First, you should register the alias domain name at a valid registrar. Secondly, you should edit the alias domain name’s name servers at the registrar and point the name servers to your webserver where your cPanel is active.
Once the name servers’ data is refreshed in the global Domain Name System, you can set the aliases. The refreshing may need up to 24 hours.
To set aliases, you should start at the main screen of cPanel. Click on Aliases and you will be redirected to a new screen. Here you can add your new alias, by simply entering the domain name in a text field. Add your alias by pressing the Add domain button.
Once your new alias is added, click on Manage Redirection link or pencil icon to set the redirection, a new subpage will appear again. Here you can enter the redirection url and save it by clicking on Save button. You can remove the already set redirection by clicking on Disable Redirection button.
To remove an alias, click on Remove link or trash icon in alias domain name’s row. The system will notify you about successful removal via an info message.
Adding and modifying Redirects in cPanel
Redirects are redirecting the visitors (and of course the web crawlers) to another url. This is a useful function when your website is moved to another domain name or you just need to redirect the visitors temporarily to a new website (for example your website is under maintenance and will be back soon).
There are two kinds of redirects, permanent and temporary redirects. Both of them have so called HTTP codes, which notify the web browser about redirection so it can perform the necessary step (forwards to you to the new destination). Permanent redirection’s HTTP code is 301, so the redirection type is often called as the 301 redirect. Temporary redirection’s HTTP code is 302, so it is called the 302 redirect.
The difference between using 301 or 302 redirects is very important and applying them in a wrong way can totally destroy your website’s traffic. When you use the 302 redirect method, the visitors will be redirected automatically to the new url, meantime web crawlers, like Google robots won’t delete your original website’s url from the Google database.
By using the 301 redirect, the visitors will be still redirected to the new url, but this type of redirection means to Google and other bots that the old url does not exist anymore and they can change the old url to the new one in the database. With this step sooner or later all of your old urls will be removed from Google’s database and only the new urls will be indexed. If your content is only temporarily moved to a new site and you want to use your old web address, never use the 301 redirect. Using wrong redirect methods could cause a mess in Google’s index, delivering you significantly less visitors and destroying your whole business.
After you have learnt what the difference between 301 and 302 redirects is, you can set your redirection in cPanel. For this, click on Redirects link on the cPanel main screen. You will be redirected to a new interface.
Here you can set the redirect type, choosing type 301 or 302. In the next dropdown menu you can select which domain or subdomain should be redirected. You can also select that the redirection should be applied on all of your available domains and subdomains.
In the next text field which starts with a slash character, you can set if an exact folder or file should be redirected. For example if you want to redirect your myurl.com domain name, you shouldn’t enter anything into this text field. If you want to redirect your myurl.com/foldername folder, you should enter the foldername string to this text field.
Next, you should enter the destination url. This will be the new place where the redirection sends your visitors.
The next solution that you should consider is www redirection. If you want to redirect only those visitors to your new url, who start your url with www, then choose the Only redirect with www. option. If you don’t want to redirect those people, then choose the Do not redirect www. If you want to redirect everybody, choose the Redirect with or without www option. The latter option is the most logical choice, which is why it is set by default.
The last option is a checkbox, named Wild Card Redirect. If you choose this option, then the redirection redirects all files to the same filename in the new location. For example, you can use this option if you have many files in the same folder, but you don’t want to set one single redirection for each of them. By checking this box a person who is looking for mysite.com/page1 will be redirected to mynewsite.com/page1 automatically, even if you made a redirection from mysite.com to mynewsite.com only.
On the same interface, where you can add new redirects, you can see your already set redirects too. Here you can delete them by clicking on Delete link or the trash icon.
At this point you should know everything about how to add-on domain, manage sub-domains and create redirects properly in cPanel. If you might looking for a reliable cPanel web hosting provider, I recommend checking out or InMotion vs BlueHost comparison. Both companies offer great hosting service, expert online support and last but not least, cPanel hosting.