I want to rewrite /catalogsearch/result/index/?q=querystring
to a custom url /search/querystring
.
For this I have created a custom module and in config.xml added below code :
<global>
<rewrite>
<custom_module>
<from><![CDATA[/search\/(.*)/]]></from>
<to><![CDATA[catalogsearch/result/index/$1]]></to>
<complete>1</complete>
</custom_module>
</rewrite>
...
</global>
This rewrite code is working and rewrite to /search/?q=querystring
.
But I want to rewrite to /search/querystring
. For this I am trying below code :
<global>
<rewrite>
<custom_module>
<from><![CDATA[/search\/(.*)/]]></from>
<to><![CDATA[catalogsearch/result/index/?q=$1]]></to>
<complete>1</complete>
</custom_module>
</rewrite>
...
</global>
But this code redirect url /search/querystring
to home page.
How to rewrite catalogsearch/result/index/?q=
to custom url?