Redirecting Customers to the Homepage After Logout in Magento 2
You can set your store settings to redirect customers to the Homepage after logout. Use the Magento 2 Redirect after Login, Logout, and Registration extension to configure by following these steps:
- Log in to your Magento 2 admin panel.
- Go to Stores > Configuration.
- In the left-side menu, under the Addify Extensions section, click on Addify Custom Redirect.
- Set the “Enable” option to “Yes” to enable logout redirection.
- Scroll down to the Redirect After Logout > Logout Url section.
- Here, “Add a Redirect Rule,” enter the URL of your Home page.
- Save the configuration.
To test the logout redirection, follow the steps below:
- Log in to your Magento 2 customer account.
- Access the logout action. This can usually be done by clicking on a “Logout” link or button provided by your Magento 2 theme or using the URL /customer/account/logout.
- After logging out, you should be automatically redirected to the homepage specified in the extension settings.