0
votes

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:

$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:

$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.

2
Are you using any htaccess? - itachi

2 Answers

1
votes

I dont think a php upgrade in itself would do this but something else must have had a tinkering.

Only thing I can think of is the htaccess or the apache config/setup has been changed - perhaps all or part of your htaccess is no longer working as a result (e.g. mod_rewite no longer enabled)

Either try restoring index.php in the config and the url to see if the page loads?

Can you check if mod-rewrite enabled. Check httpd.conf is set to allowOverride ALL for your directory and that the mod_rewrite line is not commented out.

check here for full details: http://www.tildemark.com/enable-htaccess-on-apache/

In future, if it aint broke, dont update it!

0
votes

Same happened with me, couldn't figure something out but i rolled back to php 5.3.x and it will work again until we get proper update for this from codeigniter team but last update was like the below

I highly doubt that this is PHP-related. I'd guess that another version of Apache (and mod_rewrite) is used with PHP 5.4 and I'd look into httpd.conf and/or .htaccess

by narfbg