What is a URL Rewrite and why would I use it?
Every time you create a page, a product, a category, a URL is generated for that information allowing your store and users to see what you created. The generated URL may not be the prettiest or easiest to remember, so we simplify them and make them unique with URL Keys. Utilizing the URL keys found in your control panel and the URL Management tools will help you get your store looking more professional, and help customers remember and navigate your store.
You may also want to invest some time in the URL Rewrites if you are migrating from another site. You can preserve your old URLs or redirect the old URLs to their new homes. Loyal customers most likely have their favorite items bookmarked and you want that bookmark to still get them to the correct page and not a 404 error.
The URL Rewrite Management tool can be used to create rewrites for products and categories, and custom rewrites for other pages in your store. When the rewrite goes into effect, any existing links that point to the previous URL are seamlessly redirected to the new address. All rewrites reference a "Target Path" and "Requested Path," as shown in the following examples:
Example 1
| Target Path: | category-1 |
| Requested Path: | catalog/category/id/6 |
| Redirect Type: | Permanent 301 |
Example 2
| Target Path: | catalog/category/id/6 |
| Requested Path: | product-url-key (for an internal page) http://zoeycommerce.com (for an external website) |
| Redirect Type: | Permanent 301 |
The following instructions show how to use the URL Rewrite Management tool to create three different kinds of redirects:
- Product Rewrite
- Catalog Rewrite
- Custom Rewrite
To add a product rewrite:
- Navigate to Advanced > URL Rewrite
- In the upper-right corner, click the Add URL Rewrite button.
- In the Add New URL Rewrite section, set Create URL Rewrite to "for Product."
- Find the product in the list below and click to open the record.
Click on the Enable Filter button to search. - If your item is in multiple categories, you can edit the URLs for each instance.
- Click on the Category to edit the Product's URL specifically in that category
- To edit the product's URL regardless of category, scroll down to the bottom of the Category Selection, and click the Skip Category Selection button.
- In the URL Rewrite section, do the following:
- In the Request Path field, enter the new value for the updated URL. The Request Path must be unique for each rewrite.
- Set Redirect to one of the following:
- Temporary (302)
- Permanent (301) - best option for SEO
- For your own reference, enter a brief description of the rewrite.
- When complete, click the Save button.
To add a category rewrite:
- Navigate to Advanced > URL Rewrite
- In the upper-right corner, click the Add URL Rewrite button.
- In the Add New URL Rewrite section, set Create URL Rewrite to "for Catalog."
- In the category tree, click to select the category that needs the rewrite. You can only work on one category at a time.
- In the URL Rewrite section, do the following:
- In the Request Path field, enter the new value for the updated URL. The Request Path must be unique for each rewrite.
- Set Redirect to one of the following:
- Permanent (301) - best option for SEO
- Temporary (302)
- For your own reference, enter a brief description of the rewrite.
- When complete, click the Save button.
To add a custom rewrite:
- Navigate to Advanced > URL Rewrite
- In the upper-right corner, click the Add URL Rewrite button.
- In the Add New URL Rewrite Information section, set Create URL Rewrite to "Custom."
- In the URL Rewrite Information section, do the following:
- In the ID Path field, enter the unique identifier of the original URL. To redirect any page in your store, enter the relative path to the page. For example: brand/search/result/brandname
- In the Request Path field, enter the same original URL. The Request Path must be unique for each rewrite.
- In the Target Path field, enter a valid URL for the new destination. To redirect to another CMS page in your store, enter the relative path to the new page, without a leading forward slash. To redirect to a page on different site, enter the fully qualified URL of the new destination. For example:
- new-page (URL Key of target page)
- somewhere/new-page (Relative path to target page, without a leading forward slash)
- http://www.zoeycommerce.com/ (Fully qualified URL of target page on external website)
- Set Redirect to one of the following:
- Temporary (302)
- Permanent (301) - best option for SEO
- For your own reference, enter a brief description of the rewrite.
- When complete, click the Save button.
Deleting URL Rewrites
Over the course of time, your store may accumulate rewrite records that are no longer needed. You can delete obsolete rewrites from the list individually or simply update them by clicking on the entry you wish to change.
Field Descriptions
| Options | Description |
|---|---|
| Type | Indicates the type of rewrite. The type cannot be changed after the rewrite is created. Options include: For category For product Custom |
| ID Path | The unique identifier for the rewrite rule.
For products and categories, the ID Path is automatically generated and includes the type and ID#. For example: For a custom rewrite, enter the relative path of the page to be redirected. For example: |
| Request Path | The URL key of the page that is to be redirected. For a custom redirect, the ID Path and Request Path might be the same. Depending on your configuration, it might include the .html suffix and category. For example: brandname brand/brandname brand/brandname.html The Request Path is unique, and must not have been used previously. If you have made several attempts to redirect the same page, you should delete any unsuccessful redirects and refresh your cache. |
| Target Path | The URL that points to the destination page. The Target Path can be a different CMS page, or the result of a search.
For a product or category, the Target Path is automatically generated and cannot be edited. For example: For a custom rewrite, the Target Path is entered manually. To avoid getting a 404 "Page Not Found" error, it must exactly match what the system expects to find. The following examples are valid target paths: |
| Redirect | Indicates the type of redirect. Options include: No Temporary (302) Permanent (301) |
| Description | Describes the purpose of the redirect. This field is for reference and is not visible to customers. |
Comments
0 comments
Please sign in to leave a comment.