views:

164

answers:

2

Hello I am using CodeIgniter for two applications (a public and an admin app). The important elements of the document structure are:

/admin
/admin/.htaccess
/admin/index.html
/application
/application/admin
/application/public
/system
.htaccess
index.php

The /admin/.htaccess file looks like this:

DirectoryIndex index.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

The /admin/index.php has the following changes:

$system_folder = "../system";
$application_folder = "../application/admin"; (this line exists of course twice)

And the /application/admin/config/routes.php contains the following:

$route['default_controller'] = "welcome";
$route['admin'] = 'welcome';

Welcome is my default controller.

When I call up the Domain/admin I get a 404 Page Not Found error. When I call up the Domain/admin/welcome everything works fine. In the debug logs I get the following error message:

DEBUG - 2010-09-20 16:27:34 --> Config Class Initialized
DEBUG - 2010-09-20 16:27:34 --> Hooks Class Initialized
DEBUG - 2010-09-20 16:27:34 --> URI Class Initialized
ERROR - 2010-09-20 16:27:34 --> 404 Page Not Found --> admin

Weirdly enough this setup works perfectly on my local MAMP installation (with the localdomain/admin/), but when I publish and test it on the "live" server, I just get 404 errors.

Any ideas? What am I doing wrong? Thanks C.

A: 

Your folder/file structure seems a little odd to me. I can't quite figure out how you've got this laid out.

Hello I am using CodeIgniter for two applications (a public and an admin app).

This sounds to me like you've got two separate CI installations. If this is the case, I'd recommend against it. Why not just handle all admin stuff in an admin controller? If you do want two separate CI installations, make sure they are definitely distinct entities and that the two aren't conflicting with one another. This line:

$system_folder = "../system";
$application_folder = "../application/admin"; (this line exists of course twice)

And the place you said this exists (/admin/index.php...or did you mean /admin/application/config?) has me scratching my head. You have admin/application/admin and a system folder at the top level?

treeface
That's actually how I structure my applications. I have an admin app and a web app. They both share a system folder ('../system'), and each have a separate app folder ('../application/admin'), ('../application/website').
Matthew
It is based on this: http://codeigniter.com/user_guide/general/managing_apps.html There is only one system folder. I moved the application folder to the same level as the system folder.
Casper
I meant that in the /admin/index.php file I have changed lines 26, 43 and 101
Casper
A: 

The cause of the problem was that the server was running PHP using FastCGI.

After changing the config.php to

$config['uri_protocol'] = "REQUEST_URI";

everything worked.

Casper