Re: 404 errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Taylor-Johnston wrote:
I get a lot of 404 errors. Is there a way in PHP to redirect them in such a way as it does not burn my bandwidth? Or (an Apache trick I learned once) to discourage them by referring them to localhost? Or something? Something I can embed in PHP.

IMHO unless there's a very good reason for it PHP should never get involved in handling 404 errors. By the time it gets to PHP it's wasted a fair amount of capacity. On most of my sites, where I don't need to handle 404's intelligently (i.e. showing a search results page based on the entered URL) I use the following in the apache configuration...

ErrorDocument 404 "404 Not Found"

That simply makes PHP return 404 Not Found which is about the minimum amount of bandwidth you can get away with.

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux