All about subdomains | What is it? How do I create one? etc.
Table of contents:
General information about subdomains:
- What is a subdomain?
- What can I do with a subdomain?
- Subdirectory or rather subdomain? Influence on the Google Ranking!
- How to create a subdomain & upload content?
- Can I create e-mail addresses for a subdomain?
- Wildcard subdomains & Rewrite subdomains
- Can I rename/change a subdomain?
- How can I delete a subdomain?
- Can subdomains also be used for redirects?
- Do subdomains cost extra?
- How many subdomains can be created?
- What is a subfolder/subdirectory?
- Difference between a domain and a subdomain
- How long does it take until I can use the subdomain or upload content and it is publicly available?
All pictures can be enlarged.
#What is a subdomain?
The subdomain is a subsection of the main domain. Hierarchically, it is located under the main domain and is also known as a third-level domain. It is always separated by a dot before the actual domain name.
Example: How a domain is structured
#What can I do with a subdomain?
- Subdomains are often used for extensive online projects that are accessible in different languages. So you can mark them with de.domain.tld or en.domain.tld.
- Also for large web projects with local reference or for companies with several locations subdomains are often used to better address different regions. e.g. with berlin.domain.tld or nrw.domain.tld.
- A breakdown into subdomains is also used to distinguish technical services. For example, if you want to additionally publish a shop, a forum or an area for logged-in members on a website.
At alldomains.hosting, for example, we use the subdomain manage.alldomains.hosting for the customer centre.
#Subdirectory or rather subdomain? Influence on the Google Ranking!
In most cases, the use of subdirectories makes more sense! The important thing is how Google handles subdomains.
Google considers subdomains as independent domains, which means that links, authority and trust do not affect the main domain and vice versa.
With a subdirectory, it behaves exactly the other way round. All incoming links also count towards the authority of the entire website.
For publicly accessible content that is relevant to your entire website, you should therefore prefer to choose a subdirectory.
If the Google rankings are not relevant for you, the subdomain is completely different content or a member area that is only visible with login, you can use a subdomain without hesitation.
#How to create a subdomain & upload content?
Creating a subdomain is independent of your CMS like WordPress.
In short, the process looks like this:
#1. log into customer center & adjust DNS records
A subdomain is created via a DNS record. To do this, log in to your customer center. Under Purchases -> Nameserver services -> DNS-Service for [yourDomain.tld] -> edit zone records you can create the entry for the subdomain.
There are 2 variants, but the result is always the same. Either you create an A record with the IP address of the hosting package. Or you create a CNAME record with your domain.
Variant 1: A-record with IP address
First you need to find out the IP address of your hosting package.
If you have a hosting package at alldomains.hosting, you will see the field "IP address for the hosted product" under the DNS records. Alternatively, you can find the IP address in the customer center under Purchases -> Hosting Packages -> Hosting package for [yourDomain.tld] -> show details.
This is what a DNS entry for blog.domain.tld that points to the IP address 18.104.22.168 looks like:
Variante 2: CNAME-record with your domain
Alternatively, a CNAME record is also possible. In this case, simply enter [yourdomain.tld] as the destination.
Note: The DNS entries are changed in a few minutes. It can take up to 24 hours until they are globally adopted on all DNS servers.
With the DNS Lookup you can check if the DNS entries are already adopted:
#2. Upload content for the subdomain - 2 variants
Recommended: Variant 1 is the right solution in almost every case. For example, if you want to create your own website & email accounts.
Variant 1: Load content into own root directory - required for own website & emails.
This configuration is required if you want to run a website or e-mail accounts for your subdomain which are completely independent from the main domain. A multi-domain hosting package Paket is required for this variant.
You make the settings in the Control Panel module Domains.
Via "Add new domain" domains and subdomains can be easily added to the hosting package:
Now enter the subdomain and select whether e-mails and/or websites should be hosted for the subdomain.
With Web root you specify the directory in which the website will be located later.
Important: This directory may not be located within the www directory (instead of www/shop/ one level higher in shop/).
Then the subdomain appears in the list. If the DNS record is already active, you can start uploading content or installing software.
Variant 2: Load contents into the subdirectory of the main domain.
Preparation: Start the Hosting Control Panel module Domains and select for the main domain Action -> Website settings. Then activate the setting Subdomains wildcard.
The subdomain is now hosted and points to the main directory of the domain.
To point the subdomain to the subdirectory with the same name within the main domain, you also have to activate the setting Rewrite subdomains. You can also make this setting under Action -> Website settings
Example: The subdomain "shop.domain.tld" displays the content from the folder "www/shop". It is important that the respective folder exists. Folders can be created via FTP or the File Manager in the Control Panel.
Below you will find a description of both settings.
#Can I create e-mail addresses for a subdomain?
For multi-domain hosting packages you can create your own configuration in the control panel (described in the previous step "Upload content for the subdomain - variant 2" ) and also activate the use of e-mail services.
In addition to the A or CNAME entry (described in the previous step), a second DNS entry of type "MX" is required for the subdomain in this case:
#Wildcard subdomains & Rewrite subdomains
With the Wildcard Subdomains option, all subdomains are hosted in addition to the main domain (domain.tld). Additionally, a rewrite for subdomains can be activated, whereby a subdomain points to the subdirectory of the same name in the main domain.
Example: For the subdomain "shop.domain.tld" the contents from the folder "www/shop" are displayed.
Without this option, the contents of the main domain will be delivered. Also, a configuration can be done manually in the .htaccess file using your own rewrite rules.
#Can I rename/change a subdomain?
The subdomain cannot be changed, but you can easily create a new subdomain.
#How can I delete a subdomain?
A subdomain can be deleted in the DNS zone if you remove the corresponding DNS entry.
#Can subdomains also be used for redirects?
With the appropriate configuration on the web server, you can create a redirect. For example via an .htaccess file.
#How many subdomains can be created?
The DNS zone allows you to create an unlimited amount of subdomains.
#What is a subfolder/subdirectory?
Unlike a subdomain, which is a lower-level of your website (https://domain.tld) and therefore has the following structure: https://subdomain.domain.tld a subfolder is simply a subdirectory on the same domain, such as https://domain.tld/subfolder.
Note: Subdirectories are case sensitive. If the subdirectory is "Subfolder", it cannot be accessed under "subfolder". It is easiest to keep the names in lower case and to avoid special characters.
#Difference between a domain and a subdomain
The big difference between a domain and a subdomain is that the subdomain is a part of the domain, but not the main domain itself. The main domain itself is seen as the "root" and the subdomain is a part of it which can be used separately.
#How long does it take until I can use the subdomain or upload content and it is publicly available?
At alldomains.hosting the DNS entries are active in a few minutes. Once you have created the subdirectory, you can start working with your subdomain.
It can take up to 24 hours until your subdomain is correctly accessible from anywhere in the world. The reason for this is that the DNS changes have to be adopted by all internet providers worldwide.