Question

I want to log all 404 page in magento 1.9. we want if url contain a word,the page should redirected to specific page

I have rewrite Mage_Cms_IndexController noRoute Method,

But i dont know this correct or not and is it have event in observer ?

Was it helpful?

Solution

you can override app/code/core/Mage/Cms/Controller/Router.php controller.

if your front name does not match any route then it will go to line#91

if (!$pageId) {
die('404 page');
 return false;
}

you can add log there before return true

print $identifier into log you will get what user enters actually

Mage::log($identifier, null, 'noRoute.log', true);

that's it let me know if you faced any issue

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top