
Subdomains let you create separate sections of your website under your existing domain name without registering a new domain. With DirectAdmin, creating and managing subdomains is straightforward — this guide covers everything from creation to deletion.
What Is a Subdomain?
A subdomain is a prefix added before your main domain name, separated by a dot. For example, if your main domain is yourbusiness.com, a subdomain could be shop.yourbusiness.com or blog.yourbusiness.com. Subdomains are free to create (no registration fee) because they use your existing domain.
Common uses for subdomains include:
- Separate blog or news section (
blog.yourdomain.com) - Online store (
shop.yourdomain.com) - Staging environment for testing (
staging.yourdomain.com) - API or app endpoint (
api.yourdomain.com) - Member portal or login area (
members.yourdomain.com)
Accessing Subdomain Management in DirectAdmin
To manage subdomains, log in to your DirectAdmin control panel at the URL provided by AsiaGB (typically yourdomain.com:2222). Once logged in, look for the Your Account section and click Subdomain Management. This page lists all existing subdomains and gives you tools to add or remove them.
Creating a Subdomain — Step by Step
- In DirectAdmin, navigate to Subdomain Management.
- In the Create Subdomain form, type the subdomain prefix in the text field (e.g., type
shopto createshop.yourdomain.com). - If you have multiple domains on the account, select the correct domain from the dropdown menu.
- Click Create. DirectAdmin will automatically create a corresponding folder inside your
public_htmldirectory. - Upload your website files to the newly created folder.
Note: The subdomain folder is automatically created with the same name as the subdomain prefix (e.g., public_html/shop). No DNS changes are required — DirectAdmin handles the DNS record automatically for subdomains on your hosting account.
Setting the Document Root for a Subdomain
By default, DirectAdmin sets the document root for a new subdomain to a folder matching the subdomain name inside public_html. If you need to point the subdomain to a different directory — for example, if you are installing a framework that uses a nested public folder — you can change the document root.
How to Change the Document Root
- Go to Subdomain Management in DirectAdmin.
- In the list of existing subdomains, find the subdomain you want to configure.
- Click the subdomain name or the pencil/edit icon next to it.
- Update the Directory field to your desired folder path (relative to your home directory).
- Click Save to apply the change.
Example: For a Laravel application installed at public_html/shop, set the document root to public_html/shop/public so that only the public folder is web-accessible.
Deleting a Subdomain
Removing a subdomain is just as easy as creating one. Follow these steps:
- Go to Subdomain Management in DirectAdmin.
- Tick the checkbox next to the subdomain you want to delete.
- Click the Delete Selected button.
- Confirm the deletion when prompted.
Deleting a subdomain removes the DNS record and disables web access to that address. However, the folder and files on the server are not deleted automatically — you must remove them manually via File Manager or FTP if you no longer need the files.
Subdomain vs Addon Domain — What Is the Difference?
Many new users confuse subdomains with addon domains, because both allow you to run separate websites inside the same hosting account. The fundamental difference lies in the domain name itself.
A subdomain is a prefix added to your existing domain, separated by a dot. shop.mysite.com and blog.mysite.com are both subdomains of mysite.com. They are free to create (no registration fee), live under the same domain name, share the same hosting account resources, and are managed entirely within the same control panel.
An addon domain is a completely separate domain name added to the same hosting account. For example, you might own mysite.com and add anotherbusiness.com as an addon — visitors see them as entirely different websites. Addon domains require a separate domain registration with an annual renewal fee.
In short: use a subdomain when you want to divide your existing brand into sections; use an addon domain when you need a completely different domain name.
When Should You Use a Subdomain?
Subdomains excel in situations where you want to separate functionality while keeping costs low. Common use cases include:
- blog.yourdomain.com — A separate blog or news section, allowing you to maintain editorial content independently from the main business site.
- shop.yourdomain.com — An e-commerce store running a different platform (such as WooCommerce or PrestaShop) without affecting the main website.
- api.yourdomain.com — A REST API or webhook endpoint for mobile apps or third-party services, cleanly separated from front-end web traffic.
- staging.yourdomain.com — A staging environment for testing new features before deploying to production, invisible to regular users.
- mail.yourdomain.com — The URL for your webmail interface, giving users a clean address to access their email.
- members.yourdomain.com — A members-only portal or login area with its own clear, memorable URL.
A situation where subdomains may be less ideal is when you want the content to inherit SEO authority from the main domain. A path-based structure such as yourdomain.com/blog tends to consolidate link equity more effectively than a subdomain, though the difference is minor for most small-to-medium sites.
Setting Up SSL Certificates for Subdomains
Creating a subdomain does not automatically give it HTTPS. You need to install an SSL certificate separately. There are two main approaches:
Option 1: Let's Encrypt Individual Certificate
DirectAdmin includes a built-in Let's Encrypt helper that can issue a free certificate for any domain or subdomain in your account. Go to SSL Certificates → Let's Encrypt, add the subdomain name to the domain list, and the system will issue and auto-renew the certificate every 90 days. This approach is ideal when you have a small number of subdomains.
Option 2: Wildcard Certificate Covering All Subdomains
If you run many subdomains and want to cover all of them with a single certificate, a Wildcard Certificate issued for *.yourdomain.com is the right choice. The wildcard covers every first-level subdomain — shop., blog., api. — but not nested subdomains like sub.shop.yourdomain.com. Wildcard certificates require DNS-01 challenge validation (adding a TXT record to your DNS zone). Paid wildcard SSL certificates from AsiaGB start at 5,000 THB/year and offer higher trust indicators.
Common Subdomain Problems and How to Fix Them
Although creating subdomains is straightforward, several issues come up frequently:
DNS Has Not Propagated Yet
After creating a subdomain, you may not be able to access it immediately. DNS propagation typically takes 5–30 minutes, and in some cases up to 1–2 hours depending on the TTL value and your ISP's DNS cache. Use a DNS lookup tool to verify that the A record has been created before troubleshooting further.
www.subdomain.yourdomain.com Does Not Work
DirectAdmin creates an A record for shop.yourdomain.com automatically, but it does not create a record for www.shop.yourdomain.com. If you want both versions to work, add a CNAME record for www.shop pointing to shop.yourdomain.com manually in DNS Management.
Redirect Loop or Wrong Redirect Target
Redirect loops often occur when the .htaccess file inside the subdomain folder contains conflicting redirect rules, or when the Document Root is set to the wrong folder. Check that the Document Root in Subdomain Management points to the correct directory, and review the .htaccess file for any rules that could cause a loop.
SSL Does Not Cover the New Subdomain
A certificate issued only for yourdomain.com will not cover shop.yourdomain.com. You must issue a new certificate that includes the subdomain, or switch to a Wildcard Certificate that covers *.yourdomain.com as described above.
Get Hosting with Unlimited Subdomains
AsiaGB hosting plans support unlimited subdomains, managed easily through DirectAdmin — perfect for running multiple web apps under one domain.
View Hosting Plans