I have my site configured through .htaccess
to do this:
ErrorDocument 403 http://www.mydomain.com/error.php?e=403
ErrorDocument 401 http://www.mydomain.com/error.php?e=401
ErrorDocument 400 http://www.mydomain.com/error.php?e=400
ErrorDocument 500 http://www.mydomain.com/error.php?e=500
error.php
logs the error and shows a user/customer friendly error page.
Also, I've added this piece of code:
if($_GET['e'] == '404' || $_GET['e'] == '403' || $_GET['e'] == '500' )
{ $error_no = $_GET['e']; } else { $error_no = '200'; }
header(' ', true, $error_code);
So when I visit mydomain.com/pagedoesnotexist
I see the error page (but the address bar still shows the non existing URL), I receive a report that a 404 page was triggers, but I took a look at my server log file, and this is what it says:
MY.IP.000.00 - - [date and time] "GET /pagedoesnotexistHTTP/1.1" 200 2450 "-" "USERAGENTINFO"
Nowhere in my server log can I see anything about 404... only 200... Why is that? How can I make it send back a 404 code? Right now I assume that bots and such always get 200, meaning OK responses when visiting non existent sites... Or am I missing something?
*and off topic: what does 2450 stand for? O_o*