How to redirect new customer account login to different page

06 Mar 2025

Axel Kee

If you have switched to the new customer account (“Customer accounts”, where the login is passwordless, one time code that is sent to customer email), by default, the customer will be redirected to their account page after they have login. This can be confusing, as they might expect to be redirected to the previous page, or the store homepage after login.

If you would like to redirect customer to a different page after login, you can change the login link (the link which customer clicks to login) to this format :

https://your-store.myshopify.com/customer_authentication/login?return_to=<the_page_to_redrect_to_after_login>

If you are using official Shopify themes like Dawn, this link is located in the sections/header.liquid file. In the file, search for “{{ routes.account_login_url }}” , and change it to the format shown above, or you can refer the examples below.

Locate login link

Some third party or older themes might use “/account/login” as the login link in the theme code, you can search for this too.

Below are some examples :

Redirect to the page where customer last visited

To redirect to the previous visited page after customer login, change the routes.account_login_url , to routes.storefront_login_url . (Remember to use double bracket to output this value)

Change to storefront url

Redirect to store home page

To redirect to the store home page after customer login, change the {{ routes.account_login_url }} , to https://{{ shop.permanent_domain }}/customer_authentication/login?return_to=%2F

Change to storefront url

Redirect to specific page

To redirect to the specific page after customer login, change the {{ routes.account_login_url }} , to https://{{ shop.permanent_domain }}/customer_authentication/login?return_to={{ “/pages/special_welcome_page” | url_encode }}

Replace the “/pages/special_welcome_page” to the page you want.

Source: Official Shopify documentation on redirect after customer login

Customize your Shopify store without coding knowledge, and gain happy customers

I will send practical tutorials and guide which you can follow without coding experience, about once a week

We respect your privacy, unsubscribe any time