Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Send a Standard looking 404 error to unwanted vistors

by Dog and Pony (Priest)
on Oct 01, 2002 at 22:33 UTC ( [id://202135]=note: print w/replies, xml ) Need Help??


in reply to Send a Standard looking 404 error to unwanted vistors

First off, I seem to recall that status should be '404 Not found', not only the number.

Secondly, for a message to display, you will have to actually print something. Such as

print $WP->h1('404 Page not found');

What you mean with 'for the particular browser you are using' I am not sure - is it that IE replaces errors with its own "friendly" pages? You should be happy if it does not for you, that is a really annoying "feature" that sometimes hides important information to the user.

If you really want it to display the built-in message, I'm not sure why it doesn't trigger. Maybe because some header is missing, may be because it recognizes that it is a script, or at least not a plain HTML doc (on the files extension).

You could, of course, redirect (IE) users to some bogus URL like so:

print $WT->redirect('/showIE404') if($browser eq 'IE');
I *hate* browser checks, but if you must, you must.

What I really think you should do is have a fun 404 page instead, like SGI's (I think) that showed a random very sad and crying baby when a page could not be found. Of course with the proper status code. Or maybe one of my personal favourites, http://icculus.org/404 (got it from someone here, was it Aristotle? Whoever it was, thanks again! :) ). And oh, try reloading it for new messages.


You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://202135]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-18 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found