On a current project, I had a requirement to redirect to the homepage once a user successfully logs in to their account. I tried a few plugins to no avail, so had a go doing it myself. Obviously Magento by default, redirects to the customers Account page although there is a setting in the admin to turn this off. However, this resorts back to redirecting the user to the previous page, ie the referred page.
To redirect to the homepage takes a few more steps, but here’s how I did it.
admin > System > Configuration > customer configuration > Login Options >
and set “Redirect Customer to Account Dashboard after Logging in” to No.
Look around line 193:
is the redirection url to customer dashboard. Change this to your desired URL.
So, for example, you can change it from this:
…which will redirect your customers to homepage after a successful login.
Hope this helps!
7 comments on “Redirect to homepage after successful login in Magento”
perfect, thanks! works as expected (Magento 220.127.116.11)
Glad it worked out David.
how to do this in Magento 2,?
Not used Magento 2 personally, so can’t really help this time.
Thanks it works perfect for 18.104.22.168.
hello thank you so much. But I need to check condition (if cart contains items) means go to (checkout page) after login or if (cart is empty) my (account page)
Thanks. it works