Subdomains and multiple databases

How I would have users register their companies and have their own database and a url that looks like this

http://usercompany.somesite.co.za

Example of url https://app.shopify…ignup/new/trial

Looking for a way of organising registered companies by keeping their databases and directories/files seperate

The example.png is showing how the directories should map to a url

You may check the hostname in the bootstrap file, choose corresponding app config and base path to create the web application, and then run it.

Can you please elaborate a bit qiang.  Sorry, but I am a total noob to Yii

some pseudo code for your bootstrap (index.php) file:



$hostName=determine hostname being requested


$configFile=determine app config based on hostname


Yii::createWebApplication($configFile)->run();


For each hostname, you may have a separate application directory storing its own MVC code and config file. The config file specifies the 'basePath' property to point to the application directory.

aaaah, now that makes a whole lot of sense  ;D. I also assume that all applications would make use of only copy of yii’s core source files

how to retrieve the page with the files in the folder with order : …/blog/protected/material/action.zip  or  action.pdf or either extension …

…  :-[