This article covers setting up a subdomain on Webhosting. This is typically a subdomain that you run on the same service as the main domain. To create a subdomain in DNS (for example, for a website hosted by another provider), follow the guide DNS – Subdomains.
In this article you will learn:
- When to set up subdomains on Webhosting
- How to create a subdomain:
- How to set up HTTPS on a subdomain
- Common problems
- Frequently Asked Questions
Subdomains on Webhosting
On Webhosting named after the main domain, you can create any number of subdomains with separate websites for this domain (and, if applicable, its aliases). Make sure that you meet the following conditions:
- In DNS records of the domain you have A records (or AAAA records) with the name * or with specific subdomains that point to the Webhosting.
- You are using the default .htaccess file in the www folder, or you have added the routing rules for the WEDOS directory structure at the end of your own .htaccess.
- In the www folder on FTP, you have the directories domains and subdom according to the requirements of the Webhosting directory structure.

If the domain does not use our DNS, perform the check at the provider of the DNS servers you actually use.
Creating a subdomain via FTP
You can create subdomain websites via FTP in the folder www/domains, or www/subdom. This choice affects how subdomains behave with respect to aliases. If you do not use aliases, we recommend using the folder www/domains.
A guide to managing files via FTP can be found in the article Webhosting – File Management.
To create a subdomain via FTP, follow these steps:
- Log in to FTP, for example using the client WebFTP ⧉ (Manual).
- Enter the folder www/subdom or www/domains.
- Create a new directory according to the instructions for the given folder.
- Upload the website files, including index.html or index.php.
Subdomains in www/subdom
Websites in the folder www/subdom are shared subdomains of all alias domains. You create a new subdomain here by creating a directory named after the subdomain itself, without the domain extension. For example, on the Webhosting domain.tld you create the subdomain shop.domain.tld by adding a folder named shop to the folder www/subdom.

Subdomains in www/domains
Websites in the domains folder are displayed exclusively on the given domain or subdomain (with or without www).
You create a new subdomain here by creating a directory with the complete domain name, including the domain extension. For example, on the Webhosting domain.tld you create the subdomain shop.domain.tld by adding a folder named shop.domain.tld to the folder www/domains.

Creating a subdomain using the application installer
If you use the application installerto build your website, you do not need to create the subdomain folder manually on FTP. Just make sure that if the following folder exists in www/domains , it is empty (otherwise the installer will return an error).
To install an application on a subdomain, simply enter the subdomain name in the first step of the installation itself, between the http:// and the domain name. For example, on the Webhosting domain.tld you create the subdomain shop.domain.tld by entering the word shop in the field between http:// and domain.tld.

Setting up HTTPS on a subdomain
Fully enabling HTTPS (activating and propagating the certificate) usually takes up to 90 minutes.
You activate HTTPS on Webhosting by following the guide Webhosting – Quick HTTPS Setup. By following the guide Webhosting – Manual HTTPS Setup you then enter the management of domains and subdomains.
Add subdomains to the certificate as follows:
- Click the Add Domains.
- In the lower part of the form, write a list of subdomains (without the main domain name) separated by commas.
- Confirm the addition with the Add Domains button at the bottom of the form.

If no error occurs, HTTPS will be active on the subdomains within 1.5 hours.
Common problems
Common problems with managing subdomains on Webhosting include:
- Error 500 on a subdomain
- The application installer cannot create a subdomain
- Incompatible .htaccess of the main website
- HTTPS does not work on a subdomain with www
Error 500 on a subdomain
Problem: After creating a subdomain in both the domains and subdom folders, the following is displayed: Error 500 Internal Server Error.
Cause: You must create the subdomain either in the domains folder or in subdom, not in both.
Solution: Delete one of the conflicting folders in domains/subdom.
The subdomain folder cannot be created by the installer
Problem: The application installer reports an error: Target directory /www/domains/sub.domain.tld is not empty.
Cause: The installer detected an existing installation, or its remnants, on FTP.
Solution: Log in to FTP and delete the entire subdomain folder in the domains folder. Do not create a new one.
Incompatible .htaccess of the main website
Problem: The .htaccess file of my content management system is not compatible with the default WEDOS .htaccess, so subdomains do not work.
Cause: Content management systems located in the www folder may overwrite the .htaccess file with their own rules, or their rules are not compatible with those in the default .htaccess.
Solution: If you have a problematic main website in the www folder, move it to the folder www/domains/domain.tld, where domain.tld is the domain of the main website. Then restore the default .htaccess.
Non-working subdomain with www
Problem: We have added a certificate on the subdomain, including the version with www. The subdomain itself works, but the version with www does not. The certificate is active for both.
Cause: This problem is common for domains using WEDOS.protection. The certificate for a fourth-level domain (of the type www.sub.domain.tld) is located on the Webhosting but not on the proxy server, so the connection is evaluated as insecure.
Solution: Redirect the subdomain with www to the fully secured subdomain without www. If you are using our default .htaccess file, add immediately below RewriteEngine On this code:
# 301 redirect www.sub.domain.tld -> sub.domain.tld
RewriteCond %{HTTP_HOST} ^www\.([^.]+\.[^.]+\.[^.]+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
Frequently Asked Questions
If I create a subdomain in both domains and subdom, which one is displayed?
An Error 500will occur. Choose one location for your subdomain and delete the duplicate subdomain.
What should the default .htaccess file in a subdomain folder look like?
The default .htaccess file is located only in the www folder. In subdomain folders you can have any .htaccess files you like. If there is a conflict between .htaccess files or a prohibited directive is entered, an Error 500.
Where does a visitor end up who enters a non-existent subdomain?
If the subdomain does not exist in either the subdom or domains folder, the content of the www folder is displayed.