With the URL Rewrites functionality, you can create both product rewrite and CMS page, even category rewrite in order to redirect the visitors to the another URL instead of the previous address if there is any change in the category URL.
In addition, Magento 2 store owners can set multiple URLs that point to the same product.
There are 3 Steps to create category rewrites in Magento 2 as explained below:
Step 1: Add the Rewrite
- On the Admin Panel,
Marketing > [SEO & Search]> URL Rewrites
- In the upper-right corner, click on
Add URL Rewrites.
- From the dropdown list of
Create URL Rewrites, choose “For Category” option.
- In the category tree, you can find the category you want to redirect.
In the URL Rewrite section, you can:
- Set the
Storeto apply the rewrites if necessary.
- In the
Request Pathfield, insert the new URL key and suffix for the product.
Redirectto Temporary(302) or Permanent (301).
- Leave some description for the rewrite.
You can now see the new product rewrite at the top of the list.
Step 2: Update the Index
- On the Admin Panel, go to
System > Tools > Index Management.
Catalog URL Rewritescheckbox.
- Choose the Reindex Data for the
Submitto update an index.
Step 3: Check the Result
Be very careful when you check the rewrite just to ensure that it works perfectly or not. Besides that, you need to ensure that the URL you set or test goes directly to intended category, rather than to a subcategory. This is a needed check you have to do.