Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

how to custom url rewrite for search results? 
 
e-mimic.com
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2008-10-23
China
 

I want to set a url rewrite page XXX.html to get search results http://mydomain/catalogsearch/result/?q=XXX
how to custom the url rewrite via these parameters?

ID Path *
Request Path *
Target Path *

Thank you very much!

 
Magento Community Magento Community
Magento Community
Magento Community
 
bristweb
Jr. Member
 
Total Posts:  15
Joined:  2008-11-13
 
e-mimic.com - 06 November 2008 03:51 AM

I want to set a url rewrite page XXX.html to get search results http://mydomain/catalogsearch/result/?q=XXX
how to custom the url rewrite via these parameters?

ID Path *
Request Path *
Target Path *


Thank you very much!

this would be very useful to know, anybody?  would also like to use the rewrites for layered navigation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
t87599875
Jr. Member
 
Total Posts:  3
Joined:  2008-08-24
 

It sound very good. but the problem is that, if the search key words is same as some of categories or products, maybe some url mistakes occured.
But if some can do it, i will like it also. because it can use the .xxx to devide them.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Luke Berg
Jr. Member
 
Total Posts:  8
Joined:  2008-09-30
 

I was able to do this, and it seemed to work just fine..

I have no idea what the id parameter is for, so I just set it to something.. here’s what I had..

ID Path: /search/ncf-membership
Request Path: search/ncf-membership
Target Path: catalogsearch/result/?q=NCF+membership

I’m assuming you can put whatever you want for request path, just don’t start with a /

I’m using Magento version 1.2.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
Wyomind
Jr. Member
 
Avatar
Total Posts:  26
Joined:  2010-11-09
 

For my part,

I was able to create url rewriting for search page in admin panel like that one :

id_path > search/test
request_path>test
target_path > catalogsearch/result/?q=test

But this did not work and I got a 404 page each time I tried to get http://www.mysite.com/test.

Looking further, I found that catalogsearch/result controller was expecting parameters as \"POST\" data and not as \"GET\" data that \’s why an error occured and send me to an 404 page.

I fixed it by writing this at line 46 in app\\code\\core\\Mage\\CatalogSearch\\controllers\\resultController.php :

$_POST[\'q\']=$_GET[\'q\'];
 
Magento Community Magento Community
Magento Community
Magento Community
 
zlomennypez
Jr. Member
 
Total Posts:  14
Joined:  2009-05-25
 

Could you give us the code, because i get errors and itÅ› not working. THX

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top