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

config url rewrite magento 2

 What Is URL Rewrite In Magento 2?

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.

What Is The Benefit Of URL Rewrite?

There are two essential benefits from rewriting the existing URLs:

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

How To Config URL Rewrite In Magento 2?

In Magento 2, the objective of URL rewrite is to diminish the index.php file appearing in 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 the URL in Magento 2. Let’s get started!

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

(Admin Panel => STORES => Configuration)

how to config url rewrites in magento 2
  • Step 2: Select Web in the left panel, under the General section

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

url rewrites magento 2 configuration
  • Step 3: Expand Search Engine Optimization section

set up url rewrite magento 2

After expanding the Search Engine Optimization, you must select Yes for the only field – Use Web Server Rewrites.

  • Step 4: Save the config

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

sitemap in magento 2

We have shown you a 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


Leave a Reply

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