Welcome Guest, Not a member yet? Register   Sign In
Two applications managed by request_uri
#1

[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
#2

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




Theme © iAndrew 2016 - Forum software by © MyBB