Magento 2 redirect readies your store to become better compatible for search engine crawling. Web developers often rely on redirects to forward a user from a specific URL to another one where relevant content is available.
With Magento 2 redirect to url shifting from domain to domain, enabling HTTPS or simply diverting the user to a new web page that is more SEo friendly is easier.
With Magento 2 url rewrite you can set up Magento redirect 301 or Magento redirect 302 straight from the admin panel.
In this brief step-by-step guide, we tell you how it is done.
Log into your Magento 2 Store Admin panel
Click on ‘Marketing’ module on the left toolbar
Under SEO & Search -> click on URL Rewrites
Click the Add URL Rewrite button located on the right top corner
From the ‘Create URL Rewrite’ drop-down menu, select Custom as the option
Next, select Default Store View from the Store drop-down list
Enter the old URL (which needs to be redirected to the new URL) in the Request Path field
Checkout – How Magento URL Redirect from Controller
Enter the target URL (the new destination URL) in the Target Path field
Choose the redirect type as Temporary (302) or Permanent (301) from the Redirect Type drop down menu
Click the Save button on the top to save the changes made. A confirming messaging indicating the URL Rewrite has been saved will pop up.
Magento 2 redirect from model to a new URL will serve beneficial in many aspects. We hope with this blog you will be able to redirect URLs from their old locations to new locations easily. Let us know if you have any queries on the same.