Thanks for replying, but header("HTTP/1.0 404 Not Found"); only works if php is an apache module I tried it and tried lots of other stuff. I think it is not possible to use apache's error documents because php-cgi don't really communicate with apache ( apache specific functions don't work [ like apache_get_modules() ] ). So I just clone them. I make a function to output the same as the apache error documents at least the header() function sends the correct header code. > On 3/15/07, Puskás Zsolt ( Errotan ) <errotan@xxxxxxxxx> wrote: > > Hello everybody. > > > > Sorry for my bad english. > > I'm using apache 2.2.3-3.3 ; php 5.2.0-8-cgi ; suphp 0.6.2-1 on debian > > "etch". I'm running php as cgi ( using suphp ). > > I can't get header ("Status: 404 Not found"); and other header (xxx) > > commands to send default error page like http://example.com/nonexistent > > would send. The browser gets 404 ( and other ) error code but I only see > > a blank page. Is it possible to use apache's errordocuments so the users > > can't see the difference? > > My main goal is to hide class php files and directories and of course > > other error pages would be useful :) . > > > > Thanks. > > You can use apache's error documents, but a user using a non-english > version of windows/linux would see the difference, as the 404 page is > translated to the users language... > > I don't know a lot of the difference between PHP and PHP running as > CGI, but the PHP documentation recommends the following command: > header("HTTP/1.0 404 Not Found"); > > And maybe this is useful: > http://bugs.php.net/bug.php?id=27345 > > Tijnema > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php