When I'm logging that time it redirects to the homepage but I don't want this.

I want to redirect that page in My account dashboard page.

In configuration System > Config > Customer > Customer Configuration > Login option > Redirect Customer to Account Dashboard after Logging is set as Yes. It is set to yes on all scopes

I don't know why this redirect to the homepage.

How to redirect page to my account.

How can I do this?

  • 1
    Make sure it is set to Yes on all scopes Dec 10, 2015 at 12:01
  • yes it is set to yes on all scopes
    – Newbie
    Dec 10, 2015 at 12:06
  • Did you clean the cache? Nov 23, 2017 at 7:50

2 Answers 2


You have to rewrite in local loginPostAction() from app/code/core/Mage/Customer/controllers/AccountController.php to app/code/local/Customer/controllers/AccountController.php Then you put this :

 public function loginPostAction(){

    if (!$this->_validateFormKey()) {

    if ($this->_getSession()->isLoggedIn()) {
    $session = $this->_getSession();

    if ($this->getRequest()->isPost()) {
        $login = $this->getRequest()->getPost('login');
        if (!empty($login['username']) && !empty($login['password'])) {
            try {
                $session->login($login['username'], $login['password']);
                if ($session->getCustomer()->getIsJustConfirmed()) {
                    $this->_welcomeCustomer($session->getCustomer(), true);
            } catch (Mage_Core_Exception $e) {
                switch ($e->getCode()) {
                    case Mage_Customer_Model_Customer::EXCEPTION_EMAIL_NOT_CONFIRMED:
                        $value = $this->_getHelper('customer')->getEmailConfirmationUrl($login['username']);
                        $message = $this->_getHelper('customer')->__('This account is not confirmed. <a href="%s">Click here</a> to resend confirmation email.', $value);
                    case Mage_Customer_Model_Customer::EXCEPTION_INVALID_EMAIL_OR_PASSWORD:
                        $message = $e->getMessage();
                        $message = $e->getMessage();
            } catch (Exception $e) {
                // Mage::logException($e); // PA DSS violation: this exception log can disclose customer password
        } else {
            $session->addError($this->__('Login and password are required.'));

    // The adding code here
    $this->_redirectReferer(); //redirect you to the previous page
    $this->_redirect('/'); // redirect you to the home page
    $this->_redirect('wishlist'); //redirect you to wishlist page for exemple

You can configure that in System > Configuration > Customer > Customer Configuration > Login options > Redirect Customer to Account Dashboard after Logging in = Yes

  • it is set as yes but its not redirect to dashboard
    – Newbie
    Dec 10, 2015 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.