I've faced the problem: my seo-specialist asked me to redirect all 404 to same url (/404.html). Not to show content on noRoute page but redirect to this url.
I've made changes in /app/code/core/Mage/Cms/controllers/IndexController.php:
/**
* Render CMS 404 Not found page
*
* @param string $coreRoute
*/
public function noRouteAction($coreRoute = null)
{
$this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
$this->getResponse()->setHeader('Status','404 File not found');
$pageId = Mage::getStoreConfig(Mage_Cms_Helper_Page::XML_PATH_NO_ROUTE_PAGE);
if (!Mage::helper('cms/page')->renderPage($this, $pageId)) {
$this->_forward('defaultNoRoute');
}
$this->_redirect($pageId);
}
It works on local version but doesn't on live.
When I comment headers it works:
// $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
// $this->getResponse()->setHeader('Status','404 File not found');
But I think it's incorrect solution, please help me.