You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Jochen Topf <jo...@remote.org> on 2002/03/21 14:33:59 UTC

Wrong error code

When not using 'EMBPERL_OBJECT_FALLBACK' an error code 500 is returned
instead of 404. When using 'EMBPERL_OBJECT_FALLBACK' success (200) is
returned instead of 404.

Is there a way to get the normal 404 error from apache? This is especially
a problem, because only URLs ending on *.html are going through Embperl in
my setup so there is a different error message for non-existing files
depending on whether they end in *.html or not. And even this is not
consistent.

http://www.example.com/foo/bar.html will result in an apache error message
if 'foo' doesn't exist and in an Embperl error message if 'foo' exists, but
'bar.html' doesn't.

Jochen
-- 
Jochen Topf  jochen@remote.org  http://www.remote.org/jochen/  +49-721-388298


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Wrong error code

Posted by Jochen Topf <jo...@remote.org>.
On Thu, Mar 21, 2002 at 07:37:29PM +0100, Gerald Richter wrote:
> From: "Gerald Richter" <ri...@ecos.de>
> To: "Jochen Topf" <jo...@remote.org>
> Cc: <em...@perl.apache.org>
> Subject: Re: Wrong error code
> Date: Thu, 21 Mar 2002 19:37:29 +0100
> 
> > >
> > > That is is intented behaviour. The fallback page should be displayed and
> not
> > > an error page.
> >
> > I still think this is wrong. The page doesn't exist, so it should return
> 404
> > so that spiders and such do the right thing. And for humans a nice
> layouted
> > page is returned. At least, it should be configurable.
> >
> 
> I prefer the current solution, but a simple soution has just come to my
> mind. Somewhere in your fallback page write
> 
> $req_rec -> status (404) ;
> 
> and it should return the 404 status

Ah, thats a good idea. I will be quiet now. :-)

Have a nice holiday, Gerald!

Jochen
-- 
Jochen Topf  jochen@remote.org  http://www.remote.org/jochen/  +49-721-388298


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Wrong error code

Posted by Gerald Richter <ri...@ecos.de>.
> >
> > That is is intented behaviour. The fallback page should be displayed and
not
> > an error page.
>
> I still think this is wrong. The page doesn't exist, so it should return
404
> so that spiders and such do the right thing. And for humans a nice
layouted
> page is returned. At least, it should be configurable.
>

I prefer the current solution, but a simple soution has just come to my
mind. Somewhere in your fallback page write

$req_rec -> status (404) ;

and it should return the 404 status

Gerald


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

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Wrong error code

Posted by Jochen Topf <jo...@remote.org>.
On Thu, Mar 21, 2002 at 03:43:08PM +0100, Gerald Richter wrote:
> > When using 'EMBPERL_OBJECT_FALLBACK' success (200) is
> > returned instead of 404.
> >
> 
> That is is intented behaviour. The fallback page should be displayed and not
> an error page.

I still think this is wrong. The page doesn't exist, so it should return 404
so that spiders and such do the right thing. And for humans a nice layouted
page is returned. At least, it should be configurable.

Jochen
-- 
Jochen Topf  jochen@remote.org  http://www.remote.org/jochen/  +49-721-388298


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Wrong error code

Posted by Gerald Richter <ri...@ecos.de>.

> When not using 'EMBPERL_OBJECT_FALLBACK' an error code 500 is returned
> instead of 404.

Yes, this is wrong. I put it on the todo list for the next release

> When using 'EMBPERL_OBJECT_FALLBACK' success (200) is
> returned instead of 404.
>

That is is intented behaviour. The fallback page should be displayed and not
an error page.

To dispaly custom error pages and get the status code use the Apache
ErrorDocument directive.


Gerald

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

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org