On Friday 11 February 2005 10:41, Dossy Shiobara wrote: > On 2005.02.11, Tom Jackson <[EMAIL PROTECTED]> wrote: > > My Config file contains: > > # > > # Server url, Proxy & Redirects > > ns_section "ns/server/${server}/redirects" > > ns_param 404 "global/file-not-found.tcl" > > ns_param 500 "global/server-error.tcl" > > And, presumably, you have enabletclpages = true.
So I'm wondering why not have an api for setting the status? I'm not sure if that would work, but only a few internally redirected pages would need to fiddle with the status. Within the ADP, you can still do a regular ns_returnXXX and set the status directly. This leaves only static files which can't twiddle with the status. While playing around with this I discovered some weird behavior with ADPs. First Problem: If you have an error in an adp, the error is logged twice to error.log. Once when the error occurs, and once when the error page displays. Actually, if there is an error finding the error page, the two errors are combined, the new error appended directly to the original error. You still get 200 OK logged to access.log. Second Problem: When you have an error in an adp, the custom error page is determined by: ns_section "ns/server/servername/adp" ns_param errorpage "path/to/error.adp" So, the 500 internal redirect setting is ignored. In addition, the path to the error page is _relative to the page which has the error_, if the errorpage path does not begin with "/", otherwise it is an absolute OS path. To get global/error.adp to work I had to setup the param as follows: ns_param errorpage "/web/m2/servers/configtest/pages/global/error.adp" Third Problem: If the server can't find the error page due to one of the problems listed above, a 200 OK of zero length is returned to the client, and logged in access.log. In addition, the following is set: ns_section "ns/server/servername" ns_param errorminsize 514 Telnet example: GET /error-test.adp HTTP/1.0 Host: maria2:8006 HTTP/1.0 200 OK MIME-Version: 1.0 Date: Sat, 12 Feb 2005 19:27:40 GMT Server: AOLserver/4.0.10 Content-Type: text/html; charset=iso-8859-1 Content-Length: 0 Connection: close Access.log Entry: 192.168.111.100 - - [12/Feb/2005:11:27:40 -0800] "GET /error-test.adp HTTP/1.0" 200 0 "" "" Error.log Entry(s): [12/Feb/2005:11:27:40.109812][20086.1099656112][-conn:configtest::1] Error: I got an error in this adp page I got an error in this adp page while executing "error "I got an error in this adp page"" invoked from within chunk: 0 of adp: /web/m2/servers/configtest/pages/error-test.adp [12/Feb/2005:11:27:40.110044][20086.1099656112][-conn:configtest::1] Error: I got an error in this adp pagecould not stat "/web/m2/servers/configtest/pages/global/error.adp": no such file or directory I got an error in this adp page while executing "error "I got an error in this adp page"" invoked from within chunk: 0 of adp: /web/m2/servers/configtest/pages/error-test.adp tom jackson -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.