Latest news

How To Config URL Rewrite in Magento 2? (5 minutes)

No comments


In simple words, the URL rewrite function in Magento 2 allows us to modify/ edit any URLs in your store (e.g: Urls of the Product page, Category page, CMS page, etc.). After changes, when anybody accesses the old URL, they will be redirected automatically to the new URL.


There are two essential benefits from rewriting the existing URLs:

  • Support SEO: you can easily change the URLs and make it shorten. Moreover, it might help the Google crawlers understand and read your site better.
  • Satisfy your customers: an URL what is well written would also be useful for readers. More particularly, it would show your customers which page they are in and therefore easy to get back if needed.


In Magento 2, the objective of URL rewrite is to diminish the index.php file appearing the the URL (after the root folder). Therefore, the remainings are things that are valuable to search engines and your shoppers. Here is an example:

  • Without URL rewrite:
  • With URL rewrite:

In this tutorial, we will show you how to configure URL rewrites in the back-end step-by-step. There are just 4 simple steps to rewrite URL in Magento 2. Let’s get started!

  • 1st step: Go the admin panel, navigate to STORES and choose Configuration (under Settings)

(Admin Panel => STORES => Configuration)

how to config url rewrites in magento 2

  • 2nd step: Select Web in the left panel, under General section

Expand the General section, then choose Web in the dropdown.

url rewrites magento 2 configuration

  • 3rd step: Expand Search Engine Optimization section

After expanding the Search Engine Optimization, you must select Yes for the only field – Use Web Server Rewrites.
set up url rewrite magento 2

  • 4th step: Save the config

Finally, you must click on Save Config to complete the URL rewrites configurartion.

sitemap in magento 2

We have shown you basic definition of the URL rewrites function in Magento 2 and more importantly, how to configure it in the back-end menu. If you have any problems when following this tutorial, be free to ask us by leaving a comment below. In the next tutorial, we will continue to show you how to generate the automatic redirects when any URL keys of products are changed, see you!

See More Our Magento “How To” Series:

How To Config Sitemap in Magento 2?

How To Use Flat Catalog In Magento 2?

How To Create And Manage Coupon Codes In Magento 2

How To Create New Cart Price Rule In Magento 2

How To Create New Catalog Price Rule In Magento 2

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
April LeeHow To Config URL Rewrite in Magento 2? (5 minutes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *