How to work with Magento Url Rewrite rules

Last modified by balexandre on Tue, March 22, 2011 05:31
Source|Old Revisions  

Url rewrite is something that it is not easy to understand, it took me several attempts to get the job done, but at the end... looking at it, it does make sense :)

Let’s imagine, for our propose example, that we want to add links to the TOP MENU that will end up in a CMS PAGE and not in the CATALOG (product view).

So we create our ‘Press room’ sub category under Manage categories

Prees room sub category

Let’s say that we what to have in the TOP MENU a link called PRESS ROOM and that should open the press room page that we already created in the CMS area as a CMS Page.

Prees room menu

as the default behavior Magento will create one Rewrite rule for every category, for every Store View, so we will end up with rewrites almost the same, only differentiating the Store View.

Default rules

Let’s get to work...

First thing to do is delete the System Rule, so we choose our Rule, press edit (right side) and it will show this:

Default rule

lets create a Custom Rule, conserve all values except the Target Path

Custom rule

lets save, and test it!

That’s it... simple right?

Now, don’t forget to do this for all Store Views if you have more than one.

For more information please read the Magento Documentation on URL Rewrites