How to Create URL Rewrites in Magento 2

The Most Popular Extension Builder for Magento 2

With a big catalog of 234+ extensions for your online store

mageplaza extensions M2

As you take visitors from the old pages to the new ones, there is a chance of traffic decrease since the old address is not linked to the new address of the page. Hence, if these problems arise, you need to reactivate the URL Rewrite, which is the default option offered by Magento 2. This option allows you to edit your URL so that customers clicking on the old link will be taken to the new link.

In this article, we’re going to show you how to create URL Rewrites in Magento 2 stores. Follow the post carefully to bring a more wonderful user experience to your shoppers.

Table of Contents

What is URL Rewrite?

What is URL Rewrite?
What is URL Rewrite?

URL Rewrite is one of the most awesome tools by Magento 2 that allows you to edit any URL linking to a product, category or CMS page. After enabling the rewrite, the visitors who access the old link will be navigated to the new address to get more information.

URL Rewrites enable store owners to insert high-value keywords that support better for the product index by search engines. Moreover, the URL Rewrite tool also allows creating extra URLs for the temporary seasonal change or permanent change while any valid path including CMS content pages can be customized by the URL Rewrite tool. But in spite of the change of the URL, the product ID and categories ID is constant.

Why are URL Rewrites significant?

Why are URL Rewrites significant?
Why are URL Rewrites significant?

To grasp why URL rewrites are significant, we need to determine the importance of URLs or uniform resource locators. Understood as a unique identifier to locate a resource on the World Wide Web, it contains a domain name that shows a web browser where to recover a resource. When it refers to your site, these URLs are often the first thing customers and web search engines will find.

Look at these examples:

  • https://avada.io/
  • https://avada.io/email-marketing/

Both of these links direct you to the same page and their only difference is how they are structured. The first one is related to the server while the second is related not only to the server but also to a product.

Here are some benefits of rewriting URLs:

Simplicity

As you rewrite the URL, it enables you to show shorter and to-the-point URLs since long and intricate ones distract the attention rather than capturing it. This brings users the wrong impression about a site.

SEO-friendly

URL rewrites enable webmasters to technically adjust the site’s hierarchy while still protecting the current URLs of the website, which needs to be static to enhance search engine optimization.

Keywords are essential to a page’s ranking position on Google search results. Rewriting URLs help SEO specialists manage the keywords within URLs no matter what technical contemplations. More significantly, this technique makes it easier for search engines to understand.

High visibility

The average length of URLs staying in the top 10 results is 37 characters. Therefore, restructuring the URLs and shortening them would efficiently boost their rankings and site visibility.

How to Enable URL Rewrites?

  1. Within the admin panel, go to Stores > Configuration > Web

  2. Go to the Search Engine Optimization tab and set the User Web Server Rewrites to Yes

  3. Click on the Save Config button

Some ways you can use URL rewrites

System URL

http://www.example.com/catalog/category/id/6

Original URL

http://www.example.com/peripherals/keyboard.html

Redirected Product URL

http://www.example.com/ergonomic-keyboard.html

Additional Category URLs

http://www.example.com/all-on-sale.html

http://www.example.com/save-now/spring-sale

How to Create URL Rewrites in Magento 2?

How to Create URL Rewrites in Magento 2?
How to Create URL Rewrites in Magento 2?

Step 1. Plan the Rewrite

To prevent mistakes, you should note down the URL of the redirect to page and the URL key of the redirect from page. If you want to make it sure, go to each page, and copy the URL from the address bar of your browser.

Step 2. Generate the URL rewrites

  1. Within the Magento admin, navigate to Marketing > SEO & Search > URL Rewrites

  2. Before proceeding, you should do the following to check that the request path is available:

  • In the search filter at the top of the Request Path column, insert the URL key of the page that will be redirected and click on the Search button.
  • If there are many redirect records for the page, choose the one that fits the applicable store view and open it in edit mode.
  • In the upper-right corner, click on Delete. When reminded, click on OK to confirm.
  1. As you come back to the URL Rewrites page, click on Add URL Rewrite

  2. Determine Create URL Rewrite to Custom

  3. Under URL Rewrite Information, follow the instructions:

  • If you have different store views, choose the Store where the rewrite applies.
  • In the Request Path field, insert the URL key and path (if applicable) of the category, product, or CMS page that will be redirected.

Note: The Request Path must be distinct for the specified store. You will notice an error as you try to save the redirect if there is already a redirect using the same Request Path. You must remove the previous redirect before creating a new one.

Within the Target Path field, insert the URL of the address. If the target is on another site, insert the fully qualified URL

Set Redirect to:

  • Temporary (302)
  • Permanent (301)

For your reference, write a short description of the rewrite.

  1. Review the following criteria before saving the redirect:
  • The Request Path includes the URL key or path of the original redirect from page.
  • The Target Path includes the URL of the redirect to page.
  1. Click on the Save button.

The new rewrite shows up in the grid at the top of the list.

Step 3. Assess the result

  1. Navigate to the homepage of your site.

  2. Follow the instructions:

  • Go to the original redirect from page.
  • In the address bar of the browser, type the name of the original redirect from page instantly after the store URL and choose Enter.
  • The new target page shows up instead of the original page request.

Conclusion

The above-described instructions are the simplest methods to implement if you would like to rewrite your Magento 2 store URL for a brand new page.

Is this tutorial helpful? Then share with your Magento friends and help make your work easy.

Increase sales,
not your workload

Simple, powerful tools to grow your business. Easy to use, quick to master and all at an affordable price.

Get Started
avada marketing automation

Explore Our Products:

People also searched for

Subscribe

Stay in the know

Get special offers on the latest news from Mageplaza.

Earn $10 in reward now!

Earn $10 in reward now!

comment
iphone
go up