Single codebase to multi sub-sites

dear all,

i am in a site development which has some sub-site, to simplify assume there is an organization with some sub-organizations. i read somewhere that if we are going to make some sub-sites it would be better to put them under the same domain with sub-directories, than to put them under a different sub-domain.

how to do that in Yii ? if we are going to use the same code base for those primary and sub-sites, any idea ?

thank you for every suggestion,.

modules will be ok . on module map to a subsite :lol:

another voice is welcome !

As yiqing95 mentioned, modules will do, another idea is to make this happen on DB level. For example having a tbl_site table and other tables reference it.

Or load config/main.php depending on the domain.

I have used the above two methods in one of my multisite projects.

thank you for suggestions, appreciate it a lot, and will learn about it,.


follow this explanation to implement its.