How to Create Custom URL Rewrite and Set Up 301,302 Redirects in Magento 2

How to Create Custom URL Rewrite and Set Up 301,302 Redirects in Magento 2

The 301 redirect is one of the most important tools that are used for search engine optimization. 301 redirect will help you maintain existing search engine rankings, so you don’t lose traffic after the transition to another URL. And now in Magento 2 you have an ability to set up these redirects by default. It’s pretty easy to set up redirects for each type of url. But let’s take a look how to create a custom rewrite for redirecting to the new URL.

At first you should log into your Magento 2 admin panel. On the admin menu select Marketing->URL Rewrites.

How to Create Custom URL Rewrite and Set Up 301,302 Redirects in Magento

Here you can create a new URL Rewrite by clicking “Add URL Rewrite” button:

How to Create Custom URL Rewrite and Set Up 301,302 Redirects in Magento

Select “Custom” in the drop-down list and fill out “Target Path” field with already prepared URL key of the page where it should be redirected. For example: hero-hoodie.html

How to Create Custom URL Rewrite and Set Up 301,302 Redirects in Magento

How to Create Custom URL Rewrite and Set Up 301,302 Redirects in Magento

After that fill out the “Request Path” field with a URL key of the page to be redirected. For example: besthoodie. And the last thing you should do is just to choose “Redirect Type”, let it be “Permanent (301)”.

How to Create Custom URL Rewrite and Set Up 301,302 Redirects in Magento

That is all. If necessary fill out the “Description” field and don’t forget to click “Save” button.

Now you can see your new rewrite at the top of the list.

How to Create Custom URL Rewrite and Set Up 301,302 Redirects in Magento

At the final step please test it out on the frontend, and make sure that it works properly.



Post a new comment

top
BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *