How do I create a subdomain and point it to an existing folder under /home/public_html?

6 posts / 0 new
Last post
#1 Fri, 08/16/2019 - 02:11
Mike C

How do I create a subdomain and point it to an existing folder under /home/public_html?

This was easy in IIS. It let you select the path for every domain / subdomain, and I'm stumped. I've gone through every option -- top level server, alias, sub-server, sub-domain and I can't find an option under any of them to change the document root.

I'm trying to do something simple:

mydomain.com mydomain/home/public_html (created with the domain and obviously works) static.mydomain.com mydomain/home/public_html/wp_content

Surely someone has done this for wordpress optimization / cookie free domains.

What am I missing?

Fri, 08/16/2019 - 08:51
scotwnw

Is that not just a redirect of static.mydomain.com to mydomain/home/public_html/wp_content/? If so, then there is a redirect page under virtualmin/server configuration.

Fri, 08/16/2019 - 19:04 (Reply to #2)
Mike C

It could be done that way, but it is sloppy and will increase page load time. I guess you can also do it in .htaccess tools.pingdom.com will ding for stuff like that.

Sat, 08/17/2019 - 14:39
scotwnw

Virtualmin puts the initial domain's public www folder in /home/user/public_html

When creating a sub domain of the above domain, it puts the public folder in /home/user/domains/sub.domain.com/public_html

Isnt that what you need? Isnt it as simple as creating subdomain of static.domain.com and put all your static files in /home/user/domains/static.domain.com/public_html ? I just did a test and it worked that way.

Sat, 08/17/2019 - 14:53 (Reply to #4)
Mike C

I don't want to put any content there. It needs to point to the existing public_html/wp-content folder

Sun, 08/18/2019 - 02:45
noisemarine

So create it using the defaults, then edit it to suit your needs.