You are here: Re: [PHP] Generating a 404 status message with header() « PHP « IT news, forums, messages
Re: [PHP] Generating a 404 status message with header()

Posted by John Nichel on 10/04/30 11:23

Eric Gorr wrote:
> I've got an ErrorDocument directive defined in my htaccess file.
>
> If I, for example, enter into my browser:
>
> http://mydomain.com/doesnotexist.html
>
> the 404 directive is triggered and 404 document correctly comes up.
>
> I have another file (doesexist.php) with the contents:
>
> <?PHP
> header("HTTP/1.0 404 Not Found");
> ?>
>
> If I enter into my browser:
>
> http://mydomain.com/doesexist.php
>
> I get a blank page. Apparently, this does not trigger the 404 directive.
>
> Should it? Is it possible to write a doesexists.php script which would
> cause the 404 directive to be triggered?
>
> I also tried: header("Status: 404 Not Found"); but this did not work
> either.

Are you looking in Apache's error logs to ensure that the 404 is not
being triggered, or just based on what is displayed in your browser?

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@kegworks.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация