Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeIgniter Backend Frontend .htaccess router
    text
    copied!<p>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.</p> <p>First of all let me show you my file structure:</p> <ul> <li>index.php (frontend bootstrap)</li> <li>backend.php (backend bootstrap)</li> <li>.htaccess</li> <li>system ( CI core ) <ul> <li>application <ul> <li>backend <ul> <li>[...] MVC related files and folders (config, controllers, models, views...)</li> </ul></li> <li>frontend <ul> <li>[...] MVC related files and folders (config, controllers, models, views...)</li> </ul></li> </ul></li> <li>codeigniter</li> <li>[...] (cache, database, scaffolding...)</li> </ul></li> </ul> <p>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:</p> <pre><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] </code></pre> <p>Well, what I need is the following:</p> <ul> <li>www.domain.com/backend/controller/action/parameters (backend.php routing)</li> <li>www.domain.com/controller/action/parameters (index.php routing)</li> </ul> <p>Hope I explained well.</p> <p>Can anyone help, please? :)</p> <p>Best regards.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload