Over the years, certain pages on your website may no longer be active. You either removed the product categories or set up a new page. Pages which are no longer active are referred to as dead or broken links. If a user clicks on a dead link, they expect to be diverted to the relevant page. If that doesn’t happen, it impacts the user experience. Instead of dedicating time to finding the right link, they will simply move to another site.
Therefore, it is imperative to fix such links. This is where the Magento 2 URL rewrite function comes into play. It allows you to edit the dead URL and replace it with an active one. Thus, when a user clicks on the old link, they are automatically diverted to the new one. This prevents your site’s traffic from going down besides ensuring a seamless user experience.
Of course, this is not the only reason you need to change the URLs. More often than not, Magento merchants need it in order to make their URLs fancy & more search engine friendly, i.e. searchable and readable. URL rewriting allows them to fill their URLs with keywords without affecting the store’s underlying structure. Once you configure URL rewrites in Magento 2, you’ll see a noticeable improvement in traffic and conversion rate.
Now, the question arises as to how to configure URL rewrites in Magento 2. This is precisely what we intend to cover in this detailed guide. There are two ways to set up Magento 2 URL rewrites – admin panel and programmatically. Let’s go through the Magento 2 URL rewrites through the admin panel in detail. If you lack the know-how or feel uncomfortable making the changes, reach out to our support team now.
First of all, you need to enable URL rewrite in Magento 2. Follow these steps:
Now, after enabling the URL rewrites, you need to enable the Magento 2 URL redirects. The main purpose of this is to permanently redirect all the old URLs to the latest URL.
Now, you can easily update/regenerate the product and category url key and all old urls will be redirected to the new ones.
Now, in order to generate URL rewrite for products, follow these steps:
If product url rewrite is not working, make sure you have cleared the cache. Upon doing this, all the old ULRs will be redirected to the updated ones.
If you're looking to update category URL, then follow these steps:
If category url rewrite is not working, make sure to refresh the cache. After refreshing cache, all the old category ULRs will be redirected to the regenerated category url.
Store admin can easily manage all the generated url rewrite from the admin panel. Magento records all the url rewrites in a single grid.
Ready Made Solution: Magento 2 Import Export URL Rewrites Extension
If you want to check what custom URL rewrites have you made, do the following:
On the Admin Panel, navigate to MARKETING -> URL Rewrites under SEO & Search section.
It will show you a table of all the regenerated URL Rewrites with the most recent on the top.
In case you see that some changes have not been applied, you can reindex from admin panel or CLI.
Check this article to programmatically add URL rewrite in Magento 2.
Magento 2 URL rewrites is something you must know if you wish to enhance your store’s performance and online visibility. In this article, we have listed the easiest method of doing so. Still got questions? If you have any issue in managing URL Rewrite in Magento 2, you can contact our support team by submitting a ticket here.
Related Articles:
This blog was created with FME's SEO-friendly blog