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

4. In the new window, enter the following text (replacing with your domain):

ServerAlias * RewriteEngine On RewriteCond %{HTTP_HOST} !^ $ RewriteCond %{HTTP_HOST} ^((.*)\.) $ 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.