CodeIgniter Forums
Problem for mapping two applications - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Problem for mapping two applications (/thread-56298.html)



Problem for mapping two applications - El Forum - 12-08-2012

[eluser]lama[/eluser]
Hello

I read the "Managing your Applications" tutorial but I have a problem to set two app in my CI.

I have application folder with two sub folder : frontend and backend.

The basic index.php file contains
Code:
$application_folder = 'application/frontend';

After I created an admin folder with a second index.php with this path
Code:
$application_folder = 'application/backend';

But when I go to localhost/myapp/ it's running with my default controler, but when I go to localhost/myapp/admin it's doesn't run. I have a 404 error...

Someone can help me ?

Thank you


Problem for mapping two applications - El Forum - 12-08-2012

[eluser]Aken[/eluser]
Your folder structure should look like this:

Code:
frontendapp/
-- config/
-- controllers/
-- models/
-- etc.../
backendapp/
-- config/
-- controllers/
-- models/
-- etc./
index.php // application_folder = frontendapp
backend.php // application_folder = backendapp



Problem for mapping two applications - El Forum - 12-08-2012

[eluser]lama[/eluser]
It doesn't work.

I would like to make an admin panel for my website at the url "myapp/admin" and I want to use "app" to display all the web site to my visitor.

I try with

Code:
localhost/myapp/
------------------------- index.php
------------------------- backend.php (which target backend folder)
localhost/myapp/frontend/
------------------------- /views
------------------------- /controllers
localhost/myapp/backend/
------------------------- /views
------------------------- /controllers


but when I type /backend I always have the 404 error

Maybe it's my htaccess :

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
RewriteRule ^(.*) index.php/$1 [L]

thanks you


Problem for mapping two applications - El Forum - 12-08-2012

[eluser]Aken[/eluser]
You need to add to your .htaccess to tell anything within the /backend folder URI to route to your backend.php index file. Otherwise everything will be yoursite.com/backend.php/controller/function