Alex was calm with his answer. I thought I would post the code I wrote to solve the problem based on its answer.
public function noRouteAction($coreRoute = null) { $this->getResponse()->setHeader('HTTP/1.1','404 Not Found'); $this->getResponse()->setHeader('Status','404 File not found'); $path = $this->getRequest()->getPathInfo(); if (!startsWith($path, '/media/')) { if (!startsWith($path, '/images/')) { if (!startsWith($path, '/ebay/')) { if (!startsWith($path, '/app/')) { Mage::log('JCS:noRouteAction:path:'.$path); } } } } $pageId = Mage::getStoreConfig(Mage_Cms_Helper_Page::XML_PATH_NO_ROUTE_PAGE); if (!Mage::helper('cms/page')->renderPage($this, $pageId)) { $this->_forward('defaultNoRoute'); } }
I also added the startsWith function:
function startsWith($haystack, $needle) { $length = strlen($needle); return (substr($haystack, 0, $length) === $needle); }
source share