premanshu Posted August 21, 2012 Share Posted August 21, 2012 (edited) Have two dedicated servers. One with PHP-CLI and other with Fast-CGI + PHP-FPM both hosted with Apache 2. Hosted same prestashop on both the servers for testing after changing the prestashop config files Website works perfectly fine on PHP-CLI. There is 404.gif image for products which do not have image On PHP-CGI, Fast-CGI + PHP-FPM Everything looks fine except that on 404 status return for an Image url, the url is not redirected to /img/404.gif It has something to do with below in 404.php but I am not sure what else is needed on the server to correct it. if (in_array(substr($_SERVER['REQUEST_URI'], -3), array('png', 'jpg', 'gif'))) { require_once(dirname(__FILE__).'/config/settings.inc.php'); header('Location: '.__PS_BASE_URI__.'img/404.gif'); exit; } Please help if anyone is aware of a solution. Edited November 8, 2012 by premanshu (see edit history) Link to comment Share on other sites More sharing options...
premanshu Posted August 21, 2012 Author Share Posted August 21, 2012 Ok.. Found a temporary fix.. Added 302 found header in above code. Please let me know if there is any other possibility. if (in_array(substr($_SERVER['REQUEST_URI'], -3), array('png', 'jpg', 'gif'))) { require_once(dirname(__FILE__).'/config/settings.inc.php'); header('HTTP/1.1 302 Found'); header('Location: '.__PS_BASE_URI__.'img/404.jpg'); exit; } Link to comment Share on other sites More sharing options...
Recommended Posts