Thursday, 11 July 2013

Magento Shorten the URL of a Module / Rewrite

Write this below code under the <global> in config.xml(app\etc) file.


       <rewrite>
<fancy_url>
<from><![CDATA[/path_name(.*)/]]></from>
<to><![CDATA[modulename/controllername/function_name/]]></to>
<complete>1</complete>
</fancy_url>

                <!--   This code for passing parameters  -->
<fancy_url>
<from><![CDATA[/path_name\/(.*)/]]></from>
<to><![CDATA[modulename/controllername/function_name/parameters/$1/]]></to>
                 <!--Current url = www.storename.com/deb/index/view/username/demo -->
<complete>1</complete>
</fancy_url>
</rewrite>

No comments:

Post a Comment

Thanks for your comments.