Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: users

Error documents REDIRECT_URL

 

 

Cherokee users RSS feed   Index | Next | Previous | View Threaded


skinkie at xs4all

Apr 12, 2008, 10:10 AM

Post #1 of 3 (158 views)
Permalink
Error documents REDIRECT_URL

Hi,

http://www.cherokee-project.com/archive/2005-May/000673.html

As was requested several years ago, there is a serious missing feature in
Cherokee. When someone specifies the custom error documents (CGI), the
'original' filename cannot be resolved anymore.

Cherokee should add the following envirionment variables to solve the
issue:

* REDIRECT_URL: the URL-path that was not found. If a user asks for
the nonexistent page http://www.example.com/lunch/pastrami.html, for
example, this variable is set to /lunch/pastrami.html.

* REDIRECT_STATUS: the HTTP response status resulting from the request
for the original page. In our case, this is always "404". You can use
ErrorDocument with other status codes, though, so if you have one
error-handling page for multiple statuses, you can use this variable to
determine which error status caused the error-handling page to be loaded.

* REDIRECT_ERROR_NOTES: a brief description of what went wrong, for
example, "File does not exist:
/usr/local/apache/docroot/lunch/pastrami.html".

* REDIRECT_REQUEST_METHOD: the method of the request for the original
page, such as GET or POST.


Now there is a 'cherokee_handler_cgi_add_env_pair', but I guess that this
will not affect the handler_error_redir which is used for the Error
Documents. So I guess there should be something in the style of
handler_error which a cgi execute method. (I guess a mash up like handler
phpcgi.)


Could anyone comment?


Stefan

_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee


adefacc at tin

Apr 12, 2008, 1:37 PM

Post #2 of 3 (148 views)
Permalink
Re: Error documents REDIRECT_URL [In reply to]

Stefan de Konink wrote:
>
> Hi,
>
> http://www.cherokee-project.com/archive/2005-May/000673.html
>
> As was requested several years ago, there is a serious missing feature in
> Cherokee. When someone specifies the custom error documents (CGI), the
> 'original' filename cannot be resolved anymore.
>
> Cherokee should add the following envirionment variables to solve the
> issue:
>
> * REDIRECT_URL: the URL-path that was not found. If a user asks for
> the nonexistent page http://www.example.com/lunch/pastrami.html, for
> example, this variable is set to /lunch/pastrami.html.
>
> * REDIRECT_STATUS: the HTTP response status resulting from the request
> for the original page. In our case, this is always "404". You can use
> ErrorDocument with other status codes, though, so if you have one
> error-handling page for multiple statuses, you can use this variable to
> determine which error status caused the error-handling page to be loaded.
>
> * REDIRECT_ERROR_NOTES: a brief description of what went wrong, for
> example, "File does not exist:
> /usr/local/apache/docroot/lunch/pastrami.html".

Yes, but I would add also a:

* REDIRECT_ERROR_NUMBER: an internal unique error number
that can be used by the *CGI program to show a nationalized
error message besides the standard english message.

> * REDIRECT_REQUEST_METHOD: the method of the request for the original
> page, such as GET or POST.
>
> Now there is a 'cherokee_handler_cgi_add_env_pair', but I guess that this
> will not affect the handler_error_redir which is used for the Error
> Documents. So I guess there should be something in the style of
> handler_error which a cgi execute method. (I guess a mash up like handler
> phpcgi.)
>
> Could anyone comment?

Yes, there are two distinct cases:
- redirecting to a URL pointing to a static file;
- redirecting to a URL handled by a dynamic program
(*CGI) that needs the whole request context
to show the proper user error message.

--
Nick Name: A.D.F.
E-Mail: <adefacc () tin ! it>
E-Mail-Format: Plain Text only (please); view using font Courier New
--
_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee


alvaro at gnu

Apr 12, 2008, 3:14 PM

Post #3 of 3 (147 views)
Permalink
Re: Error documents REDIRECT_URL [In reply to]

Hi Stefan,

It makes sense to me.. let me give it a thought.
I have logged a RFE to ensure we don't forget again:

http://code.google.com/p/cherokee/issues/detail?id=40

Cheers!

On 12 Apr 2008, at 12:10, Stefan de Konink wrote:
> Hi,
>
> http://www.cherokee-project.com/archive/2005-May/000673.html
>
> As was requested several years ago, there is a serious missing
> feature in
> Cherokee. When someone specifies the custom error documents (CGI), the
> 'original' filename cannot be resolved anymore.
>
> Cherokee should add the following envirionment variables to solve the
> issue:
>
> * REDIRECT_URL: the URL-path that was not found. If a user asks for
> the nonexistent page http://www.example.com/lunch/pastrami.html, for
> example, this variable is set to /lunch/pastrami.html.
>
> * REDIRECT_STATUS: the HTTP response status resulting from the
> request
> for the original page. In our case, this is always "404". You can use
> ErrorDocument with other status codes, though, so if you have one
> error-handling page for multiple statuses, you can use this variable
> to
> determine which error status caused the error-handling page to be
> loaded.
>
> * REDIRECT_ERROR_NOTES: a brief description of what went wrong, for
> example, "File does not exist:
> /usr/local/apache/docroot/lunch/pastrami.html".
>
> * REDIRECT_REQUEST_METHOD: the method of the request for the
> original
> page, such as GET or POST.
>
>
> Now there is a 'cherokee_handler_cgi_add_env_pair', but I guess that
> this
> will not affect the handler_error_redir which is used for the Error
> Documents. So I guess there should be something in the style of
> handler_error which a cgi execute method. (I guess a mash up like
> handler
> phpcgi.)
>
>
> Could anyone comment?
>
>
> Stefan
>
> _______________________________________________
> Cherokee mailing list
> Cherokee[at]cherokee-project.com
> http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee

--
Greetings, alo.

--
Greetings, alo.
http://www.alobbs.com/

_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee

Cherokee users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.