>Number: 486 >Category: mod_alias >Synopsis: REDIRECT_* variables not available! >Confidential: no >Severity: serious >Priority: medium >Responsible: apache (Apache HTTP Project) >State: open >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Fri Apr 25 06:10:01 1997 >Originator: [EMAIL PROTECTED] >Organization: apache >Release: 1.1.1 >Environment: Solaris 2.5 GNU 2.6 >Description: REDIRECT_* variables are not available in CGI script that is invoked when error 404 occurs:
ErrorDocument 404 http://www.bktv.com/cgi-bin/error The source of the script is: #include <stdio.h> #include <stdlib.h> #include <time.h> int cat(char *filename) { FILE *fp; int i; char l[256], ln[10]; fp=fopen(filename, "r"); if (fp!=NULL) { do { if ((i=fscanf(fp, "%[^\n]%[\n]", l, ln))!=EOF) printf("%s\n",l); } while (i!=EOF); fclose(fp); return 1; } else { printf("\n"); return 0; }; } int try(char *name) { char *value; value = getenv(name); printf("<TR>\n<TD><FONT SIZE=-1>%s</FONT></TD>\n", name); if (value) printf("<TD><FONT COLOR=#000080 SIZE=-1>'%s'</FONT></TD>\n</TR>\n", value); else printf("<TD><FONT COLOR=#800000 SIZE=-1><B>undefined</B></FONT></TD>\n</TR>\n"); return 0; } int main() { printf("Content-type: text/html\n\n"); cat("/www/error/404.html"); printf("<HR>\n"); printf("<H1>Detalji/Details:</H1>\n"); printf("<TABLE BORDER=2>\n"); try("SERVER_SOFTWARE"); try("SERVER_NAME"); try("GATEWAY_INTERFACE"); try("SERVER_PROTOCOL"); try("SERVER_PORT"); try("REQUEST_METHOD"); try("HTTP_ACCEPT"); try("PATH_INFO"); try("PATH_TRANSLATED"); try("SCRIPT_NAME"); try("QUERY_STRING"); try("REMOTE_HOST"); try("REMOTE_ADDR"); try("REMOTE_USER"); try("AUTH_TYPE"); try("CONTENT_TYPE"); try("CONTENT_LENGTH"); try("REDIRECT_HTTP_ACCEPT"); try("REDIRECT_HTTP_USER_AGENT"); try("REDIRECT_PATH"); try("REDIRECT_QUERY_STRING"); try("REDIRECT_REMOTE_ADDR"); try("REDIRECT_REMOTE_HOST"); try("REDIRECT_SERVER_NAME"); try("REDIRECT_SERVER_PORT"); try("REDIRECT_SERVER_SOFTWARE"); try("REDIRECT_URL"); printf("</TABLE>\n"); printf("</BODY>\n</HTML>\n"); return; } >How-To-Repeat: Try http://www.bktv.com/missing.file >Fix: I do not, sorry >Audit-Trail: >Unformatted:
