## Use --disable-path-info-check ## Don't use --enable-force-cgi-redirect diff -u -r php-4.3.3RC4.orig/main/fopen_wrappers.c php-4.3.3RC4/main/fopen_wrappers.c --- main/fopen_wrappers.c.orig Wed Jul 30 10:55:21 2003 +++ main/fopen_wrappers.c Sat Aug 23 03:03:00 2003 @@ -286,8 +286,13 @@ char *path_info, *filename; int length; - filename = SG(request_info).path_translated; - path_info = SG(request_info).request_uri; + if (getenv("REDIRECT_STATUS") || getenv("HTTP_REDIRECT_STATUS")) { + filename = SG(request_info).path_translated; + path_info = SG(request_info).request_uri; + } else { + filename = getenv("SCRIPT_FILENAME"); + path_info = SG(request_info).request_uri; + } #if HAVE_PWD_H if (PG(user_dir) && *PG(user_dir) && path_info && '/' == path_info[0] && '~' == path_info[1]) { @@ -318,7 +323,7 @@ } } else #endif - if (PG(doc_root) && path_info) { + if (PG(doc_root) && path_info && (getenv("REDIRECT_STATUS") || getenv("HTTP_REDIRECT_STATUS"))) { length = strlen(PG(doc_root)); if (IS_ABSOLUTE_PATH(PG(doc_root), length)) { filename = emalloc(length + strlen(path_info) + 2); diff -u -r php-4.3.3RC4.orig/sapi/cgi/cgi_main.c php-4.3.3RC4/sapi/cgi/cgi_main.c --- sapi/cgi/cgi_main.c.orig Tue Aug 12 19:01:59 2003 +++ sapi/cgi/cgi_main.c Sat Aug 23 02:50:54 2003 @@ -823,10 +823,14 @@ } else { #endif /* pre 4.3 behaviour, shouldn't be used but provides BC */ - if (env_path_info) { - SG(request_info).request_uri = env_path_info; + if (getenv("REDIRECT_STATUS") || getenv("HTTP_REDIRECT_STATUS")) { + if (env_path_info) { + SG(request_info).request_uri = env_path_info; + } else { + SG(request_info).request_uri = env_script_name; + } } else { - SG(request_info).request_uri = env_script_name; + SG(request_info).request_uri = getenv("REQUEST_URI"); } #if !DISCARD_PATH if (env_path_translated)