• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Making a subdomain serve files from same directory as main domain

Daniel_Wardin

New Pleskian
Hi,

I'm setting up a SAAS service which is built on top of Laravel. To put it simply the service itself knows whether its being called from a sub.example.com or just example.com and serves a correct response accordingly. So going to sub.example.com will use the same index.php file as example.com but the routes and controllers within the application will provide a different response. sub.example.com will show a tenant login page where as example.com will show a new tenant subscription page or something else.

So when someone new subscribes I add a new entry to the database with a subdomain name for them and when a request comes from that subdomain and they are logged in it will show them their information. Easy right.

There is a problem though with setting it up with Plesk. When I add a wildcard subdomain, it will look for /subdomains/sub/ for the files which is a bit problematic since I want it to serve the files from the same place as the domain example.com.

Is there a way to configure that so that regardless of the subdomain it will try and serve the exact same content as my main domain?
 
you can choose folder for your subdomain and change to original.
But currently I get ERR_NAME_NOT_RESOLVED for this trying to do such for Opencart multistore
 
Back
Top