Problem With Homeurl And Returnurl When Log In

Hello everyone,

I’m a new user of Yii since few days and I have done my first application.

But something goes wrong :

When I log out, I’m redirected on the page ../appli/index.php and I want to be redirected on the page ../appli/site.

Moreover, I have an error : Error 404, unable to resolve the request"login".

However I can continue to navigate on my application and everything is alright…

Through this forum, I have try different methods:

    • Set the path of homeUrl in the config/main.php file


    • Change the value of homeUrl directly in the functions actionLogin() and actionLogout() in the siteController.php file.
    • In config/main.php, I have specified ‘defaultController’=>‘login’, may I have to modify it?

Nothing change…

Also, I have changed a part of my CBreadcrumbs.php file (I had the same page with the same error before doing this when I clicked on Home in the breadcrumbs) :

public function run()




—> $links[]=CHtml::link(Yii::t(‘zii’,‘Home’),[color="#FF0000"]Yii::app()->homeUrl=‘my link’[/color]); <—





before the line highlighted was only Yii::app()->homeUrl.

And it works! So why it doesn’t work if I do the same in siteController.php?

I think there is something that I didn’t understand…

Of course I have the same problem when I log in, the same Url and the same error (so with returnUrl this time).

May someone have been in same trouble than me? Thank you for your help and explanations!