Magento Redirect

How can categories in Magento be redirected to CMS pages or contact pages? This is particularly convenient for multilingual online shops, as it allows individual content elements to be represented within the category structure, such as a company profile or a link to the contact form (provided by the system at /contacts). As described in several threads, unfortunately it is not enough to create a custom rewrite that is intended to replace the system rewrite.

 

With this solution, the system rewrite "pushes" itself in front of the custom rewrite every time the indexes are rebuilt and overrides it.

 

The correct approach is to first modify the relevant system rewrite of the category by assigning it the "Permanent (301)" redirect in the rewrite management, and then create a new custom rewrite that performs the desired redirect using the correct request path. In our example, we want to modify the category with ID 9. Our request path must therefore be "catalog/category/view/id/9". We can choose the ID path freely—for the contact form, we use "kontakt.html_zu_kontakt_deutsch" as the identifier. We again select "Permanent (301)" as the redirect and "kontakt" as the target path.

With this setting, an existing CMS page named "kontakt" would now be displayed instead of the category. We therefore create another custom rewrite rule in which we enter the target path "contacts" under the request path "kontakt" (= ID path), without using a redirect.

 

Overall, however, it makes more sense, wherever possible, to display CMS pages using static blocks, as this avoids the rewrite issue altogether.

 

Tested with Magento 1.9, found at http://www.entroducing.com/view/redirect-magento-category-to-a-url.