Automatic redirects
Your store can be configured to automatically generate a permanent redirect whenever the URL key of a product or category changes. In the Search Engine Optimization section, the checkbox below the URL key indicates if permanent redirects are enabled. If your store is already configured to automatically redirect catalog URLs, a redirect is a simple update to the URL key. The process to create an automatic redirect is the same for both products and categories.
Set up automatic redirects
-
On the Admin sidebar, go to Stores > Settings > Configuration.
-
In left panel, expand Catalog and choose Catalog underneath.
-
Expand the Search Engine Optimization section.
{width="600" modal="regular"}
-
Set Create Permanent Redirect for URLs if URL Key Changed to
Yes
. -
When complete, click Save Config.
Automatically redirect product URLs
-
On the Admin sidebar, go to Catalog > Products.
-
Find the product in the list and click to open the record.
-
Expand the Search Engine Optimization section.
{width="600" modal="regular"}
-
For URL Key, do the following:
-
Make sure that the Create Permanent Redirect for old URL checkbox is selected. If not, follow the instructions to enable automatic redirects.
-
Update the URL Key as needed, using all lowercase characters and non-trailing hyphens between these characters instead of spaces.
-
-
When complete, click Save.
-
When prompted to refresh the cache, follow the links in the message at the top of the workspace.
The permanent redirect is now in effect for the product and any associated category URLs.
Automatically redirect category URLs
-
On the Admin sidebar, go to Catalog > Categories.
-
Find the category in the tree and click to open the record.
-
Expand the Search Engine Optimization section.
-
For URL Key, do the following:
-
Make sure that the Create Permanent Redirect for old URL checkbox is selected. If not, follow the instructions to enable automatic redirects.
-
Update the URL Key as needed, using all lowercase characters and non-trailing hyphens between these characters instead of spaces.
-
-
When complete, click Save.
-
When prompted to refresh the cache, follow the links in the message at the top of the workspace.
The permanent redirect is now in effect for the category and any associated product URLs.
Skip generation of product URL rewrites for category save skip-rewrite
-
On the Admin sidebar, go to Stores > Settings > Configuration.
-
In left panel, expand Catalog and choose Catalog underneath.
-
Expand the Search Engine Optimization section.
-
Set Generate “category/product” URL Rewrites to
No
. -
In the confirmation dialog, click OK to confirm the change and the removal of existing URL rewrites.
{width="350"}
-
When complete, click Save Config.