I want to redirect every 404 product to catalog search because I have anothers products with similar name.
I have a lot of products are more them 1000 products with 404, that dont exist any more, but those old link are published in another websites and users still came from that links, so to keep the user on my website I want to redirect this broke link to catalog search, NOTE: "cant do it on magento rewrite url product by product because those product dont exist anymore"
I am thinking to do some route on source code to do some like this:
OLD link: http://www.mywebsite.com/iphone-5-16GB.html -> broke link
REDIRECT TO: http://www.mywebsite.com/catalogsearch/result/?q=iphone+5+16gb
I cant find any solution here on stackoverflow and nothing on Google results.
How can I do that?