php - kohana 3.3 Routing in sub-categories -


i have code route (using kohana 3.3)

route::set('admin', '<directory>(/<controller>(/<action>))', array('directory' => '(admin)'))     ->defaults(array(         'controller' => 'main',         'action' => 'index',     ));  route::set('default', '(<controller>(/<action>(/<id>)))')     ->defaults(array(         'controller' => 'main',         'action' => 'index',     )); 

when enter www.my_site/admin, works correctly.

all users must authenticated, redirect controller, happens.

public function before() {     parent::before();     controller::redirect('admin/users/login'); ... 

however, following error:

kohana_http_exception [ 404 ]: requested url admin/users/login not found on server.

how can redirect/route www.my_site/admin/user/login?

as mentioned, controller , function exist?

also recommended create url redirecting via route

$route = route::get('admin')->uri(array(     'controller' => '..',     'action' => '..', )); controller::redirect($route); 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -