>
> I am attempting to send a 404 not found message from an Embperl
> script. Here
> is the code I am trying to use in its simplest form. This is
> test.html. Note
> that it contains no HTML.
>
> [-
>   $req_rec->status('404');
>   $req_rec->header_out('Content-Length' => undef);
>   exit;
> -]
>
>...
> Oh! So close! But the Content-Length makes the client think that there is
> something worth displaying. Both NS and IE show a blank page. What I'd
> rather see is the server's error page.
>
> The question: How do I keep Embperl from adding the content length to the
> headers when I want to send an error message?
>

You can't keep Embperl from doing so, but that isn't really the problem. The
problem is that you have to tell Apache to generate the error page for you.
In a Apache::Registry script you can do this by

sub notfound
        {
        return 404 ;
        }

but this isn't possible within a Embperl page. So either use
Apache::Registry for that purpose, because you won't display any HTML
anyway, or use your code above and generate your own errorpage, instead of
let Apache do this for you. This should work quite well

Gerald



-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     [EMAIL PROTECTED]         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------

Reply via email to