Using Subdomains for multiple apps - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Using Subdomains for multiple apps (/showthread.php?tid=75879) |
Using Subdomains for multiple apps - gkfraser - 03-26-2020 Has anyone setup or know how you would setup your folders to share 1 codeigniter install for multiple apps using subdomains. Lets say I want to use site1.domain.com and site2.domain.com as my public folders which contain the index.php files. site1.domain.com -index.php site2.domain.com -index.php where should the app, writable and testable folders sit? Where should the system folder sit? Any suggestions? RE: Using Subdomains for multiple apps - jreklund - 03-26-2020 Personally I don't have multiple index.php files, I change the url and settings with environment variables from Nginx/Apache. But that means you need to have a "real" server and not using shared hosting. If that's not possible just place it one level up codeigniter4 -app -... site1.domain.com -index.php site2.domain.com -index.php RE: Using Subdomains for multiple apps - anthos1984 - 03-28-2020 I have done this and it work: 1. The server should use 1 folder which have 1 subfolder for each subdomain. I apply shared hosting which support this. 2. Here the structure: -site1 --app --public ---index.php -site2 --app --public ---index.php -system -writable 3. Edit the path for accordingly on app/config/paths.php for both site1 and site2. You can copy one to another. Also edit pathspath line on public/index.php. both on site1 and site2 4. Point site1.domain.test to folder site1/public/index.php also on site2 accordingly. This should be supported on the eserver |