How to redirect same page or Homepage instead of Customer dashboard?

Here is my code: Magento 2.1.1

<?php if( $isLoggedIn ) { ?>                                    
    <li class="first">
        <a id="quick_sigup_link" style="positon:relative;" href="<?php echo $this->getUrl('customer/account/'); ?>">
                <span>Hello. User</span>
                <span class="youraccount" style="margin-top:-25px;">My Account</span>

1 Answer 1


1- On the Admin sidebar, tap Stores. Then under Settings, choose Configuration.

2- In the panel on the left, under Customers, choose Customer Configuration.

3-Expand the Login Options section.

4- Set Redirect Customer to Account Dashboard after Logging in to one of the following:

    Yes - The account dashboard appears when customers log in to their accounts.
    No - Customers can continue shopping after logging in to their accounts.

5- When complete, tap Save Config.

6- Click the Cache Management link in the yellow modal that shows up

7- Select the Configuration and Page Cache checkboxes.

    Page cache

8- Click Submit to refresh the two selected cache types.

  • I was trying this several times but it's not working. Now what I will do? Jan 9, 2017 at 6:00
  • It always worked for me, now I have no idea, either you can do it in the code or i promose you to open another tiquet for this.
    – PЯINCƎ
    Jan 9, 2017 at 8:39

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