How to Create a Subdomain

I tried to create a subdomain but it was created to the right side of the site name, it was created like this: Custom Application Development Software for Business - Salesforce.com and I would like it to look like this: www.subdomain.site.com

I tried to create a subdomain but it was created to the right side of the site name, it was created like this: www.site.com/subdomain and I would like it to look like this: www.subdomain.site.com

When you create child-domain/sub-domain its directory structure is relative to the master domain such as:

/home/site.com/public_html/sub.site.com

That does not mean you have to access it this way, you can access it directly like a normal website at sub.site.com

The path mapping does not have to do anything with a subdomain, or I misinterpret your question?

I tried to create a subdomain but it was created to the right side of the site name, it was created like this: www.site.com/subdomain and I would like it to look like this: www.subdomain.site.com

When you create child-domain/sub-domain its directory structure is relative to the master domain such as:

/home/site.com/public_html/sub.site.com

That does not mean you have to access it this way, you can access it directly like a normal website at sub.site.com

The path mapping does not have to do anything with a subdomain, or I misinterpret your question?

Yes that’s right, so is it just to create a redirect via .htaccess that would work?

I tried to create a subdomain but it was created to the right side of the site name, it was created like this: www.site.com/subdomain and I would like it to look like this: www.subdomain.site.com

When you create child-domain/sub-domain its directory structure is relative to the master domain such as:

/home/site.com/public_html/sub.site.com

That does not mean you have to access it this way, you can access it directly like a normal website at sub.site.com

The path mapping does not have to do anything with a subdomain, or I misinterpret your question?

Yes that’s right, so is it just to create a redirect via .htaccess that would work?

Why would you need a rewrite?

A rewrite is only needed if you want to map your sub-domain to master domain. For that, you can also use aliases: https://docs.cyberpanel.net/doku.php?id=alias

Is there no way to configure a sub-domain directory to appear at the same level as public_html, ie /home/domain.com/sub-domain.com?

If you leave the path blank as Path: /home/domain/ that should do the trick

2 Likes

When creating a new sub-domain there is a PATH variable. You can enter your desired path in the path field.
/home/domain.com/ <desired directory/path>

1 Like

@ayaan yes Usman very kindly incorporated this feature about 2 days after I asked about it :grinning: Hopefully your excellent notes/screenshot will help others.

But this is been there since long. Which feature is been incorporated?

@die2mrw007 back in 2020 the sub-domain folder use to be added in the public_html folder, but since v2.0.1 the path can be specified (github ref).

1 Like

I see, we are currently at version 2.1.2