How to Create URL Rewrites in Magento 2
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?
- Why are URL Rewrites significant?
- How to Enable URL Rewrites?
- Some ways you can use URL rewrites
- How to Create URL Rewrites in Magento 2?
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?
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:
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:
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.
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.
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?
Within the admin panel, go to Stores > Configuration > Web
Go to the Search Engine Optimization tab and set the User Web Server Rewrites to Yes
Click on the Save Config button
Some ways you can use URL rewrites
Redirected Product URL
Additional Category URLs
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
Within the Magento admin, navigate to Marketing > SEO & Search > URL Rewrites
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.
As you come back to the URL Rewrites page, click on Add URL Rewrite
Determine Create URL Rewrite to Custom
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.
- 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.
- Click on the Save button.
The new rewrite shows up in the grid at the top of the list.
Step 3. Assess the result
Navigate to the homepage of your site.
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.
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.
not your workload
Simple, powerful tools to grow your business. Easy to use, quick to master and all at an affordable price.Get Started
Explore Our Products:
People also searched for
- magento 2 url rewrite
- url rewrite magento 2
- url rewrites magento 2
- url rewrite in magento 2
- magento 2 url rewrites
- magento2 url rewrite
- magento 2 url rewrite management
- magento 2 url rewrite extension
- magento 2 rewrite url
- rewrite url magento 2
- rewrite magento 2
- magento 2 rewrites
- magento 2 url structure
- magento 2 rewrite
- magento url rewrite
- magento 2 url redirect
- magento 2 url rewrite not working
- magento url rewrites
- url rewrites
- url rewrite magento
- magento url rewrite management
- magento rewrites
- configure url rewrite magento 2
- url rewrite generator magento 2
- magento url rewriting
- url rewrites magento
- magento 2 custom rewrites
- magento 2 url generator
- magento 2 url
- magento 2 redirect url
- 2.2.x, 2.3.x, 2.4.x