Knowledge Base

Search

  • Video block
  • Video Tutorials

  • Watch our easy-to-follow video tutorials for quick tips on designing and managing your store.
  • View Video Tutorials

Creating URL Rewrites

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.html
Requested Path:catalog/category/id/6
Redirect Type:Permanent 301

Example 2

Target Path:catalog/category/id/6
Requested Path:product.html (for an internal page)
http://magentocommerce.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
Product URL Rewrite
Product URL Rewrite

To add a product rewrite:

  1. From the Admin panel, select Catalog > URL Rewrite Management.
  2. In the upper-right corner, click the Add URL Rewrite button.
  3. In the Add New URL Rewrite section, set Create URL Rewrite to “for Product.”
  4. Find the product in the list below and click to open the record.
  5. Scroll down to the bottom of the Category Selection, and click the Skip Category Selection button.
  6. In the URL Rewrite section, do the following:
    1. In the Request Path field, enter the new value for the updated URL. The Request Path must be unique for each rewrite.
    2. Set Redirect to one of the following:
      • Temporary (302)
      • Permanent (301)
    3. For your own reference, enter a brief description of the rewrite.
  7. When complete, click the Save button.
Adding Product URL Rewrite
Adding Product URL Rewrite

To add a category rewrite:

  1. From the Admin panel, select Catalog > URL Rewrite Management.
  2. In the upper-right corner, click the Add URL Rewrite button.
  3. In the Add New URL Rewrite section, set Create URL Rewrite to “for Catalog.”
  4. Category URL Rewrite
    Category URL Rewrite
  5. In the category tree, click to select the category that needs the rewrite.
  6. In the URL Rewrite section, do the following:
    1. In the Request Path field, enter the new value for the updated URL. The Request Path must be unique for each rewrite.
    2. Set Redirect to one of the following:
      • Temporary (302)
      • Permanent (301)
    3. For your own reference, enter a brief description of the rewrite.
  7. When complete, click the Save button.
Catalog URL Rewrite Information
Catalog URL Rewrite Information

To add a custom rewrite:

  1. From the Admin panel, select Catalog > URL Rewrite Management.
  2. In the upper-right corner, click the Add URL Rewrite button.
  3. In the Add New URL Rewrite Information section, set Create URL Rewrite to “Custom.”
  4. Custom URL Rewrite for CMS Page
    Custom URL Rewrite for CMS Page

  5. In the URL Rewrite Information section, do the following:
    1. 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
    2. In the Request Path field, enter the same original URL. The Request Path must be unique for each rewrite.
    3. 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://magentocommerce.com (Fully qualified URL of target page on external website)
    4. Set Redirect to one of the following:
      • Temporary (302)
      • Permanent (301)
    5. For your own reference, enter a brief description of the rewrite.
  6. 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 either individually or as a group of selected records.

To delete rewrites:

  1. In the list, select the checkbox of each rewrite to be deleted.
  2. Set the Actions list box to “Delete.”
  3. Click the Submit button.
Deleting Rewrites
Deleting Rewrites

Refreshing the Search Index

If you change the settings of an existing URL Rewrite, it can take up to five minutes—and sometimes more—for the change to propagate throughout the system. Your store’s search index, as well as your browser cache must be cleared before the changes take effect in your store.

To refresh the search index:

  1. From the Admin menu, select Catalog > Search Indexing.
  2. Click the Refresh Index button.
    It usually takes from 3-5 minutes for the change to take effect. However, depending on the time of day, it may take longer.  If you don’t see the change right away, you might need to clear the cache of your browser.

Clearing Your Browser Cache

If the changes made to a redirect don’t seem to be taking effect, try a different browser, or follow the instructions below to clear the cache of your current browser.

To clear your browser cache:

  • For Internet Explorer, on the Tools menu, select Delete Browsing History. Then, select the Temporary Internet Files checkbox, and click the Delete button.
  • For Firefox, on the Tools menu, select Clear Recent History. Then, select the Cache checkbox, and click the Clear Now button.
  • For Chrome, in the upper-right corner, click the icon with three horizontal lines. On the Tools menu, select Clear Browsing Data. Then, select the Empty the cache checkbox, and click the Clear browsing data button.

Field Descriptions

OptionsDescription
TypeIndicates the type of rewrite. The type cannot be changed after the rewrite is created. Options include:
For category
For product
Custom
ID PathThe unique identifier for the rewrite rule.

For products and categories, the ID Path is automatically generated and includes the type and ID#. For example:
product/164

For a custom rewrite, enter the relative path of the page to be redirected. For example:
brandname
brand/brandnamebrand/search/result/brandname

Request PathThe 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 PathThe 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:
catalog/product/view/id/164

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:
brandname
brand/brandname
catalogsearch/advanced/result/?brand=brandname
http://magentocommerce.com

RedirectIndicates the type of redirect. Options include:
No
Temporary (302)
Permanent (301)
DescriptionDescribes the purpose of the redirect. This field is for reference and is not visible to customers.