Hey guys.
Using URLManager is possibly create a rule that redirect the user to another application ( like backend ) ?
Something like this:
'components' => [
'urlManager' => [
'rules' => [
'' => 'backend/site/default/index',
Aboalnoor
(Adnanalabuo)
2
i think you must put a slash at the first like so
'components' => [
'urlManager' => [
'rules' => [
'' => '/backend/site/default/index',
or try to add a full link
try it & let me know the result 
In this way you are not making redirect, you are simply matching empty request to specific action.
If you need really a redirect, you should handle empty request to an action and then make redirect, as:
'components' => [
'urlManager' => [
'rules' => [
'' => 'default/index',
In DefaultController:
public function actionIndex() {
return $this->redirect('backend/site/default/index');
}
I think that this is the simplest solution to do it.
That is already my solucion. But with that we loose session variables, like this:
-
Yii::$app->session->setFlash(‘danger’, Module::t(‘users’, ‘BACKEND_FLASH_FAIL_ADMIN_CREATE’));
-
Refresh the application;
-
Goes do frontend; ( that have a redirect to backend ).
-
Goes to backend ( via redirect, session variables are lost because of the redirect );
I already tried that, but the URLManager class don’t support that 