Rewrite url using config.xml in magento


To rewrite url using config.xml file in magento. We are insert below code to tab <global> in etc/config.xml file of you module.


  • Package name: khactung
  • Module name: test
  • Url before rewrite: oldurl, oldurl/ticket
  • Url after rewrite: newurl, newurl/post


         <!--rewrite url for controller (oldurl to newurl)-->
         <!--rewrite url for function (oldurl/ticket to newurl/post)-->

Some example after rewrite:

  • oldurl/ticket/          -> newurl/post/
  • oldurl/ticket/data  -> newurl/post/data
  • oldurl/ticket/123   -> newurl/post/123


Leave a Reply

Your email address will not be published. Required fields are marked *