CodeIgniter Forums
Customs routes no longer working (possibly php 5.4 issue) (CI 2.1.3) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Customs routes no longer working (possibly php 5.4 issue) (CI 2.1.3) (/showthread.php?tid=56324)



Customs routes no longer working (possibly php 5.4 issue) (CI 2.1.3) - El Forum - 12-10-2012

[eluser]jelatin[/eluser]
Alright, my application has been running fine for a few months now. Starting this morning all of my custom routes no longer work.

Have a controller named 'stuff' in a folder named 'mL'. Set up a custom route:

Code:
$route['default_controller'] = "mL/stuff";

Then visit 'website.com/', works fine, gets me to the 'controllers/mL/stuff' controller. Now, if I try to use a custom route:

Code:
$route['stuff'] = "mL/stuff";

and visit 'website.com/stuff' I get sent to my 404 page (as set in $route['404_override']).

This is true of all of my controllers, if I set it as the default_controller it works without issue. Someone else upgraded the server to php 5.4.9 over the weekend, and it's the only thing I can think of that might affect this, but I can't figure out how/why.


Customs routes no longer working (possibly php 5.4 issue) (CI 2.1.3) - El Forum - 12-10-2012

[eluser]Aken[/eluser]
Do you have another route that's catching it first? Routes are fired in order from top to bottom, and once one matches, it stops there. Might help to comment out everything except the one you're testing.

Otherwise /system/core/CodeIgniter.php is the file that does the main logic. Look through it and debug and figure out what's weird.


Customs routes no longer working (possibly php 5.4 issue) (CI 2.1.3) - El Forum - 12-11-2012

[eluser]jelatin[/eluser]
It ended up requiring a change to the .htaccess which has been unaltered for months.

I changed

Code:
RewriteRule ^(.*)$ /mL/$1 [L]

to

Code:
RewriteRule ^(.*)$ /mL/index.php/$1 [L]

and it worked fine in PHP 5.4. No idea why.


Customs routes no longer working (possibly php 5.4 issue) (CI 2.1.3) - El Forum - 12-11-2012

[eluser]Aken[/eluser]
Is your CI install inside the mL folder? If so, why is mL also in your routes?