Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 2.0 - you can longer name a controller 'system' out of the box.

[eluser]Ollie Rattue[/eluser]
This is not a bug, but a change which has come about in the release of CI 2.0.

After spending hours trying to work out why a mod_rewrite (pretty url) would not work on CodeIgniter 2.0 when it did in 1.7.2, I feeled compelled to post. Perhaps this very specific situation it will save someone some time...

It turns out that you can longer name a controller 'system.php'. I don't know the exact details of why the rewrite used to work and doesn't now, and unfortunately don't have the time to spend hacking to work that one out. The .htaccess code in http://codeigniter.com/wiki/mod_rewrite/ mentions that it allows a controller system.php but this appears not to be the case (perhaps it has not been updated (or tested) since the new CI release).

My quick and dirty solution was to rename the systems directory to system_files and update the setting in index.php in the root directory. I needed my controller to be called system.php for legacy support with an old system, so this was the fastest/easiest solution.

If your .htaccess contains a rewriterule using -d (test if directory exists), you can not have a first URI segment that is equal to a folder in your document root. That is not limited to system, but also applies to application, assets, files, and whatever you might have there.

Solution is to dump your -f and -d rewrite rules, and only exclude from rewriting what you don't want to rewrite.

Also, as of CI 2.0 your system folder contains a .htaccess as well with a deny all. If that is processed first (which now that I think of it is quite likely), access is denied before it ever gets to your rewrite rules...

Theme © iAndrew 2016 - Forum software by © MyBB