How to change the directory of a subdomain

DirectAdmin allows changing the docroot of a subdomain from the user account. For the default domain, the subdomain directory will be:

/home/USERNAME/domains/DOMAIN.COM/public_html/SUBDOMAIN

Changing this can be useful if you want to put the subdomain’s directory outside of the public_html of the main domain. For example, configuring the subdomain in:

/home/USERNAME/domains/SUBDOMAIN.DOMAIN.COM/

Notice1. The custom path must exist prior to configuring it in DirectAdmin.

Notice2. Instead of creating a subdomain for the main domain, you can add another domain (DirectAdmin >> Account Manager >> Domain Setup) as the subdomain.


How to change the directory of a subdomain in DirectAdmin

1. Connect to your DirectAdmin account

2. Navigate to Account Manager >> Subdomain Management

3. Click the pencil icon on the Docroot column for the specific subdomain.

4. Select Custom option for the Public HTML Root and Private HTML Root fields and enter your custom directory.

5. Click the Save button. You just changed the default directory for the subdomain.

directadmin subdomain docroot
DirectAdmin custom directory for subdomain

Leave a Reply