CodeIgniter Forums
Two sites - one ci - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Two sites - one ci (/showthread.php?tid=38571)



Two sites - one ci - El Forum - 02-11-2011

[eluser]dianikol85[/eluser]
As the title says I need to run two sites with one installation of CI 2.0.

The first one is the backend and the second one the frontend. A CMS like. What i need to do in order to achieve that?

I am sure that i need to have to application folders but i don't where should put them and what other configuration i need to do.

For example:

1) website.com : the front-end, the actual site for users

2) website.com/administrator : the back-end where i make changes like inserting data to a db which data are going to be shown in the front-end.

I'm sure many people here need to do this.

Thanks in advance!!


Two sites - one ci - El Forum - 02-11-2011

[eluser]kirkaracha[/eluser]
How to: Multi-site CodeIgniter Set-up
How to: Support multiple production environments in CodeIgniter
CodeIgniter Base Classes: Keeping it DRY
Managing your Applications : CodeIgniter User Guide


Two sites - one ci - El Forum - 02-12-2011

[eluser]dianikol85[/eluser]
these are not clear. They miss things about configuration.


Two sites - one ci - El Forum - 02-12-2011

[eluser]dianikol85[/eluser]
ok, i manage this as follows:



Code:
application/
          controller/
                    admin/
                    frontend


Then i add this line in routes.php: $route['admin'] = 'admin/(and the controller you want to be the default in the admin controller)';


Two sites - one ci - El Forum - 02-12-2011

[eluser]ramm[/eluser]
I have it like that and i didn't have to put anything in routes.php, it works just fine.


Two sites - one ci - El Forum - 02-13-2011

[eluser]dianikol85[/eluser]
if i remove the $routes['admin'] = 'admin/...' when i type in the URL mywebsite.com/admin it redirects me to the default controller that i have set here :$route['default_controller']


Two sites - one ci - El Forum - 02-13-2011

[eluser]ramm[/eluser]
I have in my routes the default controller set to
Code:
$route['default_controller'] = 'main';
And i have my folders (and controllers) like this:
Code:
application/
    controllers/
        admin/
            main.php
        main.php
    views/
        admin/
            main_admin_view.php
        main_front_view.php