Redirect to another module

Hi everyone, I want to redirect from a module to another module but I can’t. This is my code:




namespace frontend\modules\Calificacion\controllers;


class CalificacionController extends Controller

{

    public function actionIndex()

    {

           return $this->redirect('Configuracion/configuracion/index');     

    }

}



Of course I want to redirect to Configuracion module but it doesn’t work.

Please help

Try


return $this->redirect('/Configuracion/configuracion/index');

or


return $this->redirect('//Configuracion/configuracion/index');

Thanks for response and sorry for delay.

With first option I get:

  • localhost/Configuracion/configuracion/index

With second option:

  • configuracion/configuracion/index

It doesn’t work…

Any idea?

I think we need to know what you want to obtain to better understand the problem, localhost/Configuracion/configuracion/index for me is correct.

is your base domain localhost?

is the path /Configuracion/configuracion/index ?

so you want as result http://localhost/Configuracion/configuracion/index ?

then




return $this->redirect('/Configuracion/configuracion/index');



is correct.

Thank for replies. I solved it in this way…


namespace frontend\modules\Calificacion\controllers;


class CalificacionController extends Controller

{

    public function actionIndex()

    {

           return $this->redirect(\yii\helpers\Url::base() . 'Configuracion/configuracion/index');     

    }

}