Knowledgebase

How to set up and edit URL rewrites in Magento

Magento creates automatically URL rewrites for products and categories. These are search engine friendly URLs. The rewrite path, also referred to as a request path or a URL key, is created by using the name of the product or category. You can change this path when adding/editing the product or category. In case of products, in the admin panel of your Magento go to Catalog>Manage Products, then click on the Add Product button or on the Edit button of an existing product, depending on whether you want to add or edit a product, and on the page that opens (the General page) there's an option URL Key. Simply type the path in the field for that option; use lowercase letters and separate words with hyphens. The path will be added to the base URL address and the whole thing will form the URL address of the product's details page.

Categories also have a URL Key option. It can be configured on the General Information page. Just go to Catalog>Manage Categories and then select the category you want to edit, or click on the Add Category button if you want to create a new category.

There's a system setting connected with URL rewriting. It's disabled by default but this will not prevent you from editing the URL Key option of products and categories. To enable this setting go to System>Configuration>Web button on the left>Search Engines Optimization panel on the right. Set the Use Web Server Rewrites to Yes and click on the Save Config button.

A convenient way to edit URL rewrites and add new ones is the URL rewrite manager. To use it, in the admin panel go to Catalog>URL Rewrite Management. This will display a table with the rewrites of all the products and categories that you've created. To edit any of them click on its row in the table, on the page that opens change the Request Path to whatever you want the new one to be and click on the Save button.

To add a new rewrite click on the Add URL Rewrite button that's above the upper right corner of the table with the existing rewrites. On the following page select from the Create URL Rewrite drop-down menu whether you want to create a rewrite for a category, a product, or a custom one (e.g. for a CMS page). Then, depending on whether you selected for a category or a product, choose the category or the product on the following page, and on the next page you'll be able to configure the Request Path option.

For some more details and screenshots read the tutorial on URL rewriting in Magento.

Was this answer helpful?

 Print this Article

Also Read