![]() |
Multisite with codeigniter HMVC - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12) +--- Thread: Multisite with codeigniter HMVC (/showthread.php?tid=169) |
Multisite with codeigniter HMVC - sanjay - 11-07-2014 Can we able to create the multisite with codeigniter HMVC Like i have main domain www.example.com , want to create subdomain like www.demo1.example.com, www.demo2.example.com, www.demo3.example.com, likewise. We must want to use same codebase, database. Only the subdomain different. Any reference for this is really helpful, Thanks in advance. Sanjay RE: Multisite with codeigniter HMVC - gofrendi - 11-07-2014 (11-07-2014, 05:21 AM)sanjay Wrote: Can we able to create the multisite with codeigniter HMVC You must want to see this http://blogid.me It was built by using No-CMS (http://getnocms.com) which is built on top of CodeIgniter & HMVC RE: Multisite with codeigniter HMVC - khalilhimura - 11-15-2014 Try checking out this tutorial http://code.tutsplus.com/tutorials/basecamp-style-subdomains-with-codeigniter--net-16330 Maybe you could get some ideas about CI with subdomains. I'm trying to do something similar & currently going through the tutorial myself. or perhaps another way is to have a single "system" folder with multiple "application" folders, like so: [web root folder] system -- main CI system folder app-main -- application folder for domain : example.com app-sub1 -- application folder for sub1 subdomain : sub1.example.com app-sub2 -- application folder for sub2 subdomain : sub2.example.com If the subdomains are to be dynamic names (e.g. username), the tutorial above would do the job. I'll report back here once I'm done with the tutorial & see the outcome. RE: Multisite with codeigniter HMVC - trentramseyer - 12-05-2014 Really depends if they are running independently of each other as khalilhimura suggested you can just load different application folders per domain. Or if you are doing a multi-site system that will grow dynamically, you can store the domain in the database table with the site information and look that up to get site information (make sure you index the domain field). All your tables will need a site_id of some sort to look up information. Something like below in model will let you look up. PHP Code: function site_lookup() |