in reply to Re^2: 404 to Apache
in thread 404 to Apache

It doesn't appear that will happen. You can send a '404' status through the header status CGI print $q->header(-status=>404); (which works, it does send a 404 error to the browser) but Apache seems to ignore it. As one might expect, since a 404 should normally occur before the script is called.

You'll either have the use the Apache modules or parse the config for the standard Apache (ErrorDocument 404 /missing.html) page and return that along with the header status of 404.



grep
One dead unjugged rabbit fish later

Replies are listed 'Best First'.
Re^4: 404 to Apache
by Anonymous Monk on Oct 29, 2006 at 05:20 UTC
    Add  -nph => 1,
Re^4: 404 to Apache
by artist (Parson) on Oct 30, 2006 at 20:03 UTC
    From CGI.pm docs:
    print redirect(-uri=>"http://somewhere.else/in/movie/land", -nph=>1, -status=>301);
      The -status parameter will set the status of the redirect.  HTTP
           defines three different possible redirection status codes:
    
                301 Moved Permanently
                302 Found
                303 See Other
     The default if not specified is 302, which means "moved temporarily."
           You may change the status to another status code if you wish.  Be
           advised that changing the status to anything other than 301, 302 or
           303 will probably break redirection.
    
    
    
    That means, I cannot return 404, if I redirect. Is there any way around?
    --Artist
      I read that also, but I actually tried it before I posted. It does really work, my browser reported a 404.


      grep
      One dead unjugged rabbit fish later
      Depends, what does the RFC say?