Wednesday, August 4, 2010

Dumps: Magento URL Rewrites

If you'll ever need to get something like:
 /path/product/12321.html to point to /path/product/view/id/12321/type/html/
 /path/product/12321.json to point to /path/product/view/id/12321/type/json/
you can add this in your Magento extension config.xml:
...
<global>
  <rewrite>
    <Namespace_Module>
      <from><![CDATA[#^/path/product/(\d+)\.(json|html)$#]]></from>
      <to><![CDATA[/path/product/view/id/$1/type/$2/]]></to>
    </Namespace_Module>
  </rewrite>
...

No comments:

Post a Comment