wez             Thu Feb  5 15:35:12 2004 EDT

  Modified files:              
    /livedocs   error.php 
  Log:
  IIS tweaks; IIS does not like a # character in a Location header;
  it will interpret it as part of the local URL, fail, and serve a
  404 instead.  Using a ? before it solves this problem.
  
  
http://cvs.php.net/diff.php/livedocs/error.php?r1=1.5&r2=1.6&ty=u
Index: livedocs/error.php
diff -u livedocs/error.php:1.5 livedocs/error.php:1.6
--- livedocs/error.php:1.5      Thu Feb  5 09:57:33 2004
+++ livedocs/error.php  Thu Feb  5 15:35:12 2004
@@ -18,10 +18,11 @@
 // | Handles the 404 error and try to redirect to the good place.         |
 // +----------------------------------------------------------------------+
 //
-// $Id: error.php,v 1.5 2004/02/05 14:57:33 wez Exp $
+// $Id: error.php,v 1.6 2004/02/05 20:35:12 wez Exp $
 
 /* handle IIS style 404 handler */
 if (strncmp($_SERVER['SERVER_SOFTWARE'], "Microsoft", 9) == 0 &&
+        isset($_SERVER['QUERY_STRING']) &&
         strncmp($_SERVER['QUERY_STRING'], "404;", 4) == 0) {
 
     $rurl = parse_url(substr($_SERVER['QUERY_STRING'], 4));
@@ -48,7 +49,7 @@
             if ($db_m[0][1] < 5 || (sqlite_fetch_string(sqlite_unbuffered_query($idx, 
"SELECT count(*) FROM searchi WHERE skey='" . sqlite_escape_string($lookup_name) . "' 
AND prio=5")) == 1)) {
                 $current_page = $lang . '/' . $db_m[0][0] . '.html';
                 if (@file_exists(OUTPUTDIR . '/' . $current_page)) {
-                    header('Location: ' . WEBBASE . $current_page . '#' . 
$db_m[0][0]);
+                    header('Location: ' . WEBBASE . $current_page . '?#' . 
$db_m[0][0]);
                     exit;
                 }
             } else {

Reply via email to