- Help Center
- Server Administration
- DirectAdmin
DirectAdmin: Automatic subdomain creation
1. Log into DirectAdmin as admin user.
2. Go to the Custom HTTPD configurations section.
3. Select the required domain, for example domain1.com.
4. In the new window, enter the following text (replacing domain1.com with your domain):
ServerAlias *.domain1.com RewriteEngine On RewriteCond %{HTTP_HOST} !^www.domain1.com $ RewriteCond %{HTTP_HOST} ^((.*)\.)domain1.com $ RewriteRule ^/(.*) /%2/$1
5. Save your changes.
6. Log into DirectAdmin as the user who created the domain. Select a domain and go to DNS Management
7. Add A-record (use domain IP):
After saving the changes, all folders in the root directory will be identified as subdomains.
If you have any questions, please create a ticket to technical support.