Why am I able to access my subdomain as a sub-directory?

Recently, a customer ran into an issue in DirectAdmin where they were able to access their subdomain directory as a sub-directory of their main domain. This might not be a major issue for everyone, but it is still a concern that should probably be addressed.

How does DirectAdmin handle subdomains?

By default, when you add a subdomain through the Subdomain Management page, it creates the subdomain directory in the following tree:

  • /home/{user}/domains/{maindomain}/{subdomain}

When you think about how that would work, you realize that you are able to access the subdomain via {domain}/{subdomain}. This may cause some issues with the configuration of their site and possibly even cause issues with their SEO rankings.

You may be tempted to recreate the subdomain entry and change either the private_html or the public_html directories. However, you’ll come to find that DirectAdmin does not handle this well and still does not utilize the new directory. Instead, DirectAdmin sticks to utilizing the folder under the main domain as the public_html directory.

How do we fix this issue?

The best way around that we were able to find is to add the subdomain in the Domain Setup page.

  1. Navigate to DirectAdmin control panel
  2. If you have a Reseller Account, click the “User” tab if this is for your own site.
  3. Expand Account Manager
  4. Click “Domain Setup”
  5. Here, all domains you have added to your account are listed.
  6. On the right, click “+ Add New”
  7. In the “Domain” field, enter your full subdomain.domain.tld entry.
  8. If you desire to specify bandwidth and disk usage options, please adjust as necessary.
  9. Additionally, if you need to specify different options for Secure SSL, CGI Access, and PHP Access, update the checkboxes as necessary.
  10. Click the Create button.
  11. Now, when you access the File Manager, navigate to My Files > Domains
  12. You should now see your subdomain as a regular domain. This is the originally desired result for most people.

While that was not a difficult fix, this is something we are looking forward to having DirectAdmin fix going forward.

Have you run into any other issues like this? Do you need assistance with your site? Feel free to either submit a ticket or email us for assistance!

Copyright © 2021 ProResellserHost, LLC - ProResellerHost.com. All rights reserved.