Category URL rewrites
If a category is removed from your catalog, you can use a category rewrite to redirect links to the URL of another category in your store. Think in terms of target / original request or redirect to / redirect from. Although people might still navigate to the former page from search engines or outdated links, the redirect causes your store to switch to the new target.
If automatic redirects are enabled for your store, there is no need to create a rewrite when a category URL Key is changed.
Step 1. Plan the rewrite
To avoid mistakes, write down the redirect to path and redirect from path and include the URL Key and suffix (if applicable).
If you are not sure, open each category page in your store, and copy the path from the address bar of your browser.
Example:
Redirect to: gear/backpacks-and-bags.html
Redirect from: gear/bags.html
Step 2. Create the rewrite
-
On the Admin sidebar, go to Marketing > SEO & Search > URL Rewrites.
-
Before you proceed, do the following to verify that the request path is available:
-
In the search filter at the top of the Request Path column, enter the URL key of the category that is to be redirected and click Search.
-
If there are multiple redirect records for the page, find the one that matches the applicable store view and open the redirect record in edit mode.
-
In the upper-right corner, click Delete. When prompted, click OK to confirm.
-
-
When you return to the URL Rewrites page, click Add URL Rewrite.
-
Set Create URL Rewrite to
For category
and choose the target category in the tree that is the destination of the redirect.{width="700" modal="regular"}
-
In the URL Rewrite section, do the following:
-
If you have multiple stores, select the Store where the rewrite applies.
-
For Request Path, enter the URL key of the category that the customer requests. This is the redirect from category.
note note NOTE The request path must be unique for the specified store. If there is already a redirect that uses the same request path, you receive an error when you try to save the redirect. The previous redirect must be deleted before you can create one. -
Set Redirect to one of the following:
Temporary (302)
Permanent (301)
-
For your reference, enter a brief description of the rewrite.
{width="700" modal="regular"}
-
-
Before saving the redirect, review the following:
- The link in the upper-left corner displays the name of the target category.
- The Request Path contains the path for the original redirect from category.
-
When complete, click Save button.
The new category rewrite appears at the top of the URL Rewrites grid.
Step 3. Test the result
-
Go to the home page of your store.
-
Do one of the following:
- Navigate to the original redirect from category.
- In the address bar of the browser, enter the path to the original redirect from category immediately after the store URL and press Enter.
The new target category appears instead of the original category request.
Field descriptions
Custom
/ For category
/ For product
/ For CMS page
No - No redirect is specified. Many operations create redirect requests of this type. For example, every time you add products to a category, a redirect of the
No
type is created each store view.Temporary (302) - Indicates to search engines that the rewrite is for a limited time. Search engines generally do not retain page rank information for temporary rewrites.
Permanent (301) - Indicates to search engines that the rewrite is permanent. Search engines generally retain page rank information for permanent rewrites.