Skip to content

Magento Redirects

To compensate for the 404 error (page not found), we need to create a 301 re-direct. It helps customers and search engines to stay away from 404 errors. Nullify the 404 errors, or it will lead to a sales loss.

To prevent 404 errors, Magento 2 provides native tools. 301 is used for permanent redirect, while 302 is for a temporary redirect. Customers are redirected to corresponding pages automatically when 301 and 302 are correctly implemented. Cases for redirection required are as listed:

  • Unavailability of a specific category of products
  • Changes in URLs
  • Migrated to a new website from an old one

To generate a 301, 302 redirects, follow these steps:

Marketing Tab -> URL rewrites -> Add URL rewrite

Let's jump on the options we have.

  • Store: Choose the store for which the redirect will be enabled
  • Request Path: Enter the URL to redirect
  • Target Path: Enter the URL where the page will be redirected
  • Redirect Type: Choose 301 and 302 as per your need
  • Description: Fill it out to remind the admin why this redirection is done

After filling out all the components, hit the Save button.

Pretty simple! Right? This is how merchants can set 302 and 302 redirects to avoid 404 in your Magento 2 store.


Last update: 2022-06-29