http://www.perlmonks.org?node_id=830471


in reply to Re: Doing a proper 404 redirect
in thread Doing a proper 404 redirect

Well, it kinda is a Perl question, since I want to be able to "express" a 404 error using Perl.

Regarding the 404, there was some wrong thinking on my part:) It's of course up to me to show relevant info when the 404 is made. But, I still want search engines and such to "get" that a 404 has been made.

In other words, I want to write a correct 404 header. The information displayed after that is basically up to me.

Replies are listed 'Best First'.
Re^3: Doing a proper 404 redirect
by JavaFan (Canon) on Mar 24, 2010 at 08:19 UTC
    Wait. So, given that you demonstrated you know how to print "301", you now seek knowledge how to print "404"?

    Sorry, but that's way over my head.

      No.
      I'm seeking for the _proper_ way to _signal_ a 404 to whatever visits the site (search engines, bots, etc.).
      As I wrote, there was a thought error on my behalf. I'm not looking for a redirect.

        I'm seeking for the _proper_ way to _signal_ a 404 to whatever visits the site (search engines, bots, etc.).
        Right.... And you already shown that you know the proper way to signal a 301. You print 301. Now, do you still really not understand how to print 404? Let me explain how one can print 404.
        print 404; # TADA! Magic!
        Printing an optional message and mandatory network end-of-lines is left as an excercise for the reader.

        Please come back to the site if you have problems printing a different number!