php - Confused about codeigniter routes order -


i'm learning codeigniter , stumped following:

i have these routes in routes file:

$route['(:any)'] = 'pages/view'; $route['news/create'] = 'news/create'; $route['news/(:any)'] = 'news/view/$1'; $route['news'] = 'news'; $route['default_controller'] = 'pages/view'; 

yet when load http://mysite/index.php/news," loads news page rather 'pages/view,'. thought because have catchall route @ top, page load pages/views.

where going wrong?

the reason :any doesn't match slash, @ least since ci 3.0+ . first route rule not "catch all" longer. http://www.codeigniter.com/user_guide/installation/upgrade_300.html?highlight=any#routes-containing-any


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -