After hours and hours I found this:
I added this route:
$router->add('/admin', array(
'module' => 'backend',
'controller' => 'index',
'action' => 'index'
));
now if I go to site.com/admin
backend module called but for every sub addresses (admin/*
) frontend (default) module called!
then I add this routes too:
$router->add('/admin/:controller/:action', array(
'module' => 'backend',
'controller' => 1,
'action' => 2
));
$router->add('/admin/:controller', array(
'module' => 'backend',
'controller' => 1,
'action' => 'index'
));
now every address in admin
works perfectly and use backend module. but now the frontend site won't work correctly! (All addresses except /admin/*
goes to index contrller of Frontend) and if I add this routes too:
$router->add('/index', array(
'module' => 'frontend',
'controller' => 'index',
'action' => 'index'
));
$router->add('/', array(
'module' => 'frontend',
'controller' => 'index',
'action' => 'index'
));
$router->add('/:controller', array(
'module' => 'frontend',
'controller' => 1,
'action' => 'index'
));
$router->add('/:controller/:action', array(
'module' => 'frontend',
'controller' => 1,
'action' => 2
));
now backend module (admin
and admin/*
) do not work!! :)) (frontend module called)
I'm so confused, please help me!