Magento 2 Redirect Rules: Better Way to Managing Redirects

When your visitors come across a broken link the first thing they do is go back if not leave altogether. It signals to search engines that your website is not relevant enough and discourages people from coming back. So you have to find a solution. Fast.

While you can find 404 pages and create redirects for them you can't get rid of them altogether. However, you can automate the process and stop creating multiple redirects manually. 

Thus, today you'll learn how to create SEO redirect rules using the ultimate Magento 2 SEO Extension.

Create Redirect Rules in Magento

1. Navigate to Marketing > SEO by Magefan > SEO Redirect Rules and hit the Add New SEO Redirect Rule button.

2. Enable the rule, and give it a Name and Priority.

new redirect rule magento

3. Specify the Redirect From URL, Redirect To URL and choose the Redirect Type.

4. Enable the Use for 404 Pages Only option if you want to create a redirect only from the 404 URLs.

5. Give your redirect a Description.

magento redirect rule

e.g. In our scenario asterisk (*) determines any result that comes after the search path. 

redirect from search/tops to catalogsearch/result/?q=tops
redirect from search/skirt to catalogsearch/result/?q=skirt
redirect from search/shorts to catalogsearch/result/?q=shorts
redirect from search/bag to catalogsearch/result/?q=bag

Don't forget to Save the Magento 2 redirect rule and check how it works on the frontend. The redirect rules cover multiple URLs at the same time, so you don't have to create all of them manually.

Create Redirect Rules for All 404 Pages

Our SEO redirect rules make you stop looking for the 404 pages in your SEO reports. You can create one rule and redirect people from all existing and new 404 pages. 

Just take the same steps we've described but make sure to:

  • put asterisk (*) in the Redirect From URL
  • put forward slash (/) in the Redirect To URL
  • enable the Use for 404 Pages Only option

magento redirect for 404 pages

This creates a redirect from any page that is 404 to your homepage. However, it could be any other page you redirect people to.

Although redirect rules help you automate the process, they are not the only automatic redirects you can create using our SEO tool. Explore other auto redirects and make sure people land only on relevant and enabled pages.