files being downloaded when a 404 occurs

From: Date: Sun, 10 Aug 2003 04:19:07 +0000
Subject: files being downloaded when a 404 occurs
Groups: php.general 
Request: Send a blank email to php-general+get-159016@lists.php.net to get a copy of this message
Hello, I'm using Apache 2.0.47 (Unix) with PHP 4.3.3RC2. My httpd.conf file reads : AddType application/x-httpd-php .html ... and then a little further down ErrorDocument 404 /404redir.html (404redir.hml is a PHP file, consisting of : <?php header("Location: /404.html"); ?> ) The reason why I do this is so that the Google Adsense doesnt' display welfare ads, since the 404 page contains a lot of keywords! Anyway, the problem is this. When a 404 occurs, for say a directory ... http://localhost/heidkjsdjksd .... which doesnot exist... everything works great... i get redirected as per requirement. Now when a .php files occurs .. it still works (http://localhost/sdjkdkjskd.php) .... BUT when a .html files occurs... http://localhost/crap.html .... it starts to download the file... and the browser says can't download!!! And now when I add a .php file to my AddType... it happens for the .php file too... so since i've moved my website.. and had .php files... i can't use the .php extension otherwise 404's don't get logged and taken care of! Help appreciated. thank you. Tony.

« previous php.general (#159016) next »