I’m trying to server a redirect if a customer attempts to download a file from our site that doesn’t exist.
I use a custom controller to handle the file, and within the controller, a simple check for file_exists(), and if it doesn’t, the following is run
$pageId = Mage::getStoreConfig('web/default/cms_no_route');
$url = rtrim(Mage::getUrl($pageId),'/');
the problem is that while it’s redirecting to my defualt 404 page, the initial status code being sent is 302, then followed by a proper 404.
[16:51:36.955] GET http://localhost/download/get/?id=34416&chapter;=0 [HTTP/1.1 302 Found 737ms]
[16:51:37.711] GET http://localhost/cms/index/noRoute/ [HTTP/1.1 404 Not Found 2900ms]
how can I get the initial request to serve the proper 404.