Categories
Knowledge base

Creating and Managing Subdomains in DirectAdmin

A subdomain is a prefix added to your main domain that helps organize different sections of your website or create a separate staging area. DirectAdmin makes it easy to create and manage subdomains, allowing you to build testing environments, blogs, or separate services under the same domain.

Why Use Subdomains in DirectAdmin?

  • Separate Websites: Run a different website under the same domain (e.g., blog.yourdomain.com).
  • Testing & Staging: Create a testing environment before going live (staging.yourdomain.com).
  • Better Organization: Segment your site into different sections (e.g., store.yourdomain.com).
  • Custom Services: Host different web applications separately from your main site.

Step 1: Log in to DirectAdmin

  1. Open your DirectAdmin login page in a web browser.
  2. Enter your username and password, then click Login.

Step 2: Navigate to the Subdomain Management Section

  1. In the DirectAdmin dashboard, go to Account Manager.
  2. Click on Subdomain Management.
  3. You will see a list of existing subdomains (if any).

Step 3: Creating a New Subdomain

  1. Click Create Subdomain.
  2. Enter the desired subdomain name (e.g., blog).
  3. Select the domain under which you want to create the subdomain.
  4. Click Create.
  5. DirectAdmin will automatically create a directory for the subdomain (/domains/yourdomain.com/public_html/blog/).

Step 4: Uploading Files to the Subdomain

Once the subdomain is created, you need to upload website files:

  1. Go to File Manager in DirectAdmin.
  2. Navigate to public_html/subdomain-folder.
  3. Upload your website files via File Manager or FTP.

Step 5: Setting Up a Staging Area with a Subdomain

If you want to create a staging site for testing changes before making them live:

  1. Create a subdomain (e.g., staging.yourdomain.com).
  2. Copy your website files from public_html to public_html/staging.
  3. Create a duplicate database (if necessary) and update your configuration files.
  4. Test changes on staging.yourdomain.com before deploying them to the live site.

Step 6: Managing Subdomains in DirectAdmin

  • To Edit a Subdomain: Go to Subdomain Management, click on the subdomain name, and modify its settings.
  • To Delete a Subdomain: Click the Delete button next to the subdomain.
  • To Enable SSL on a Subdomain:
    1. Go to Account Manager > SSL Certificates.
    2. Select the subdomain and enable Let’s Encrypt SSL.
    3. Click Save and test HTTPS access.

Step 7: Redirecting a Subdomain

If you need to redirect the subdomain to another page or website:

  1. Navigate to Site Redirection in DirectAdmin.
  2. Choose the subdomain you want to redirect.
  3. Enter the target URL (e.g., https://yournewsite.com).
  4. Save the changes.

Step 8: Troubleshooting Subdomain Issues

Subdomain Not Working?

  • Ensure the subdomain has propagated (DNS changes may take a few hours).
  • Check if the subdomain directory contains an index.html or index.php file.
  • Clear your browser cache and try accessing the subdomain again.

SSL Not Working on the Subdomain?

  • Ensure Let’s Encrypt SSL is enabled for the subdomain.
  • Check if the domain’s DNS records include an A record for the subdomain.
  • Restart the web service and retry.

Conclusion

Creating and managing subdomains in DirectAdmin is a great way to separate sections of your website, set up staging environments, or host new projects under your main domain. With the easy-to-use interface in DirectAdmin, you can efficiently add, manage, and delete subdomains in just a few steps.

For expert DirectAdmin hosting and subdomain management solutions, visit xldomein.com!

Calendar

March 2025
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Categories