Hi, I'm trying to develop a little base CMS with CodeIgniter for my own use on projects but got stuck on this. Also, I'm very new to CI, but got some years with ZF and OOP PHP.
First of all let me show you my file structure:
- index.php (frontend bootstrap)
- backend.php (backend bootstrap)
- .htaccess
- system ( CI core )
- application
- backend
- [...] MVC related files and folders (config, controllers, models, views...)
- frontend
- [...] MVC related files and folders (config, controllers, models, views...)
- backend
- codeigniter
- [...] (cache, database, scaffolding...)
- application
Ok. I can get to work the index.php or backend.php routing with an .htaccess, but can't get it to work with both. Here's the .htaccess code:
RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php (and throwing a 404 error)
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
Well, what I need is the following:
- www.domain.com/backend/controller/action/parameters (backend.php routing)
- www.domain.com/controller/action/parameters (index.php routing)
Hope I explained well.
Can anyone help, please? :)
Best regards.