Welcome Guest, Not a member yet? Register   Sign In
multiple sites, same code, CI_Controller error ?
#1

[eluser]Tom Vogt[/eluser]
So I thought this would be really easy - turns out it totally screws everything. Help. :-)


Here's what I want to do:

http://blabla/site1/controller/method/parameters
http://blabla/site2/controller/method/parameters
http://blabla/site3/controller/method/parameters

all should use the exact same codebase, only different databases. For the moment, I'd be happy with the first part. Now reading the forums, it seemed this would be trivial with a bit of either mod_rewrite magic or defining routes.

However, both approaches get to the same problem:
Quote:Fatal error: Class 'CI_Controller' not found in /mypath/system/core/CodeIgniter.php on line 231

Which is really, really strange, as the require code just prior to it seems to work fine and BASEPATH and APPPATH are also set correctly.


So, I'm now here, asking this:
How do I make the "site1" (2, 3...) disappear from the URL as far as CI is concerned? All I need it for is having the database config file point to the database for that site.


What I tried:
Code:
$route['(:any)/(:any)'] = '$2';

and
Code:
RewriteCond $1 !^(index\.php|css|js|images|favicon.ico|apple-touch-icon.png|crossdomain\.xml|robots\.txt)
RewriteRule ^([^/]+)/(.*)?$ - [E=PATH_APPLICATION:$1,NE]

RewriteCond $1 !^(index\.php|css|js|images|favicon.ico|apple-touch-icon.png|crossdomain\.xml|robots\.txt)
RewriteRule ^([^/]+)/(.*)?$ index.php?/$2 [L]

both result in the error above.




Theme © iAndrew 2016 - Forum software by © MyBB