Route Question About Kohana
I'am using kohana 2.3 and i have a trouble with config/routes.php.
I am redirecting www.abc.com/var1/var2 to /profile/show/var1/var2 with this line:
$config['(.*)/(.*)/'] = '/profile/show/$1/$2/)';
It's okey but also i want to redirect www.abc.com/var1/var2/feedbacks to /profile/feedbacks/var1/var2 but i can't done that. I am using this rule:
$config['(.*)/(.*)/feedba开发者_C百科cks'] = '/profile/feedbacks/$1/$2/)';
But i doesn't work. Always work first rule.
Routes are loaded and checked in the same order as they were added in config files. You should set more specific rules closer to beginning, and default route - in the end of route list:
// config/routes.php
$config['(.*)/(.*)/feedbacks'] = '/profile/feedbacks/$1/$2/)';
$config['(.*)/(.*)/'] = '/profile/show/$1/$2/)';
$config['_default'] = 'welcome';
精彩评论