CodeIgniter Forums
Two applications managed by request_uri - 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: Two applications managed by request_uri (/thread-18974.html)



Two applications managed by request_uri - El Forum - 05-24-2009

[eluser]Wievior[/eluser]
Hello,

What I want to achieve is two applications managed by request_uri variable. One would be my main site, and the other one would be administration panel.

Folders:
Code:
/new/system
/new/system/application/admin
/new/system/application/site

/new/index.php:
Code:
$adres = explode("/", $_SERVER['REQUEST_URI']);
IF($adres[2] == 'admin')
{
$application_folder = "application/admin";
}
elseIF($adres[2] == 'site')
{
$application_folder = "application/site";
}
else
{
$application_folder = "application/site";
}

/new/.htaccess:
Code:
SetEnv PHP_VER 5

RewriteEngine on

RewriteCond $1 !^([a-zA-z0-9/])

RewriteRule ^(.*)$ index.php [L]

RewriteCond $1 !^(index.php|images|robots.txt|system|user_guide)

RewriteRule ^(.*)$ index.php/$1 [L]

/new/system/application/admin/config/config.php:
Code:
$config['base_url'] = "http://mysite.com/new/admin/";
$config['index_page'] = "";
$config['uri_protocol']    = "AUTO";

I type http://mysite.com/new/admin/ and get a 404 error (one from /new/system/application/admin/errors/).

Thanks in advance for any help.

Regards,
Paul


Two applications managed by request_uri - El Forum - 05-24-2009

[eluser]Dam1an[/eluser]
Why not do it all as a single aplication, and then just have an admin folder in your controllers directory?