Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Subdomains are easy. In hosting environements, in most cases, apache is configured to catch all subdomain calls below the main domain. You just need to have a wildcard DNS defined, so *.example-app.com are pointed to IP of your server. Then your website should catch all calls to those subdomain names.</p> <p>Other domains are hard. They need to be configured as virtual hosts in Apache - see <a href="http://httpd.apache.org/docs/1.3/vhosts/name-based.html" rel="noreferrer">http://httpd.apache.org/docs/1.3/vhosts/name-based.html</a> - that means it will be difficult to automate that, especially in hosting environement - unless your host gives you some API to do just that (easy and more feasible scenario would be to have a distinctive IP assigned to your website, then you can catch all with your Apache - it's probably possible to configure using your hosting control panel or works out of the box - and then just point DNS servers to your IP). </p> <p>Then, after you have configured your Apache to point all necessary calls to your website, you can differnetiate application partitions per subdomain in this way:</p> <ul> <li>get the host header from HTTP request</li> <li>have a database table containing all subdomain names you're serving</li> <li>make a lookup to that database table to determine instance, or user, id and use it later for filtering data / or selecting a database, if you'll go with a "database per application instance" schema.</li> </ul> <p>Good luck :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload