upgraded from 3.0.1 to 3.0.2 , routes problem |
Hi, i have a problem with my custom routes !
my routes codes works fine in CI3.0.1 but after upgrading to CI3.0.2, it just shows 404 for my custom routes ! my .htaccess is works fine and correctly, since i just uploaded app/config/constants.php file and system/ folder to my host ( as mentioned in documentation of upgrading ) does anyone know, what cause the problem ?! url: http://www.akhyani.net <-- Default Controller works fine url: http://www.akhyani.net/admin <-- uses routes , shows 404 url: http://www.akhyani.net/admin/index <-- works fine O.o ! my route codes: Code: $route['default_controller'] = 'ctrl_main';
I'm having the same issue.
$route['recurring_pmt_processing'] = 'recurring_pmt_processing/process_recurring_pmt'; Called in CLI: php index.php recurring_pmt_processing ERROR: Not Found The controller/method pair you requested was not found. This was working fine before the upgrade to 3.0.2
I'd guess these are not *all* of your routes and/or in the same particular order that you've actually defined them. That makes a difference.
$route['terms-of-use'] = 'terms';
$route['privacy-policy'] = 'privacy'; $route['contact-us'] = 'gq/contact_us'; $route['demo'] = 'gq/demo'; $route['(.+)'] = "gq/account/$1/$2"; $route['(.+)'] = "gq/account/$1"; $route['recur_pmt_process'] = 'recur_pmt_proces/process_recur_pmt'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; After reading your response I modified the order to the following: $route['terms-of-use'] = 'terms'; $route['privacy-policy'] = 'privacy'; $route['contact-us'] = 'gq/contact_us'; $route['demo'] = 'gq/demo'; $route['recur_pmt_process'] = 'recur_pmt_process/process_recur_pmt'; $route['(.+)'] = "gq/account/$1/$2"; $route['(.+)'] = "gq/account/$1"; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; It's now working. Thanks!
(10-10-2015, 01:30 PM)Narf Wrote: I'd guess these are not *all* of your routes and/or in the same particular order that you've actually defined them. That makes a difference. hmmm... well, OK then, these are all my routes with the defined order: Do you have any suggestions on these ? Code: $route['default_controller'] = 'ctrl_main';
Yep ... routes are matched in the order they are defined and your '(:any)' route takes precedence. ogomez got it.
(:any) routes should always be placed last in your routes.php file
And like Narf stated they work in the order they are defined. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(10-12-2015, 05:44 AM)AminTheGreat Wrote:(10-12-2015, 04:18 AM)InsiteFX Wrote: (:any) routes should always be placed last in your routes.php file Because there was a short-circuit condition that checked for literal (non-regexp) matches first. It was removed because with new features added to the router, it increased code complexity and made it hard to maintain. |
Welcome Guest, Not a member yet? Register Sign In |