Chapters Close

How to Configure URL Rewrites in Magento 2?

This piece of information will throw some light on how one can configure URL Rewrites in Magento 2.

When the rewrite goes into effect, any links that points to the previous URL are redirected to the new address. URL rewrites make the existing URLs more “search engine friendly” and also easier for humans to read.

Enabling Web Server Apache/Nginx Rewrites is a part of the initial Magento 2 store development setup. Magento 2 uses URL rewrites to remove the file name “index.php” that normally appears in the URL just after the root folder. When Web Server Rewrites are enabled, the system rewrites each URL to omit “index.php.” The rewrite removes words that convey nothing of value to the search engines or the customers.

How to enable URL rewrites?

Step 1:

In the Admin login go to path Stores > Configuration > Web.

Step 2:

After that, expand the Search Engine Optimization section.

Step 3:

Set Use Web Server Rewrites to ‘Yes’.

And save the config.

Set up automatic redirects:

To set up automatic redirects we need to follow the steps given below:

Step 1:

In the Admin login go to path Stores > Configuration > Catalog > Catalog.

Step 2:

Expand the Search Engine Optimization section.

Set Create Permanent Redirect for URLs if URL Key Changed to “Yes.”  and save the config value.

Now to check the automatic redirection. Go to the product edit page from the admin section.

 In the URL Key field, perform the following steps:

  • Make sure that the Create Permanent Redirect for old URL checkbox is selected. 
  • Update the URL Key as needed, using all lowercase characters and hyphens. 
  • Save the product and test the product on the store frontend.
  • To view the redirect records, go to : Marketing > SEO & Search > URL Rewrites from the admin section. The most recent permanent redirects appear at the top of the list.
Speak your Mind

Post a Comment

Got a question? Have a feedback? Please feel free to leave your ideas, opinions, and questions in the comments section of our post! ❤️

* This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Grow your online business like 3,640 subscribers

    * This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
    envelope

    Thank You!

    We are reviewing your submission, and will be in touch shortly.