From 429422d91fc8ab4fa092ccbe1dbe086d76a02899 Mon Sep 17 00:00:00 2001 From: Gabor Hojtsy Date: Fri, 7 Nov 2003 18:20:43 +0000 Subject: [PATCH] Put this image redirectio to the right place --- error.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/error.php b/error.php index 27e9ac461..4c76969a7 100644 --- a/error.php +++ b/error.php @@ -25,8 +25,12 @@ $URI = substr($_SERVER['STRIPPED_URI'], 1); $URI = urldecode(preg_replace("!(\\?.*$)!", "", $URI)); // ============================================================================ -// For images, display a 404 automatically (no redirect) -if (preg_match("!\\.(pdf|gif|jpg|png)$!i", $URI)) { error_404(); } +// Perform a redirect for manual figures, other images display a 404 automatically +if (preg_match("!^manual/(\\w+)/(print|printwn|tableless)/figures/(.+)$!", $URI, $parts)) { + mirror_redirect("/manual/$parts[1]/figures/$parts[3]"); +} elseif (preg_match("!\\.(pdf|gif|jpg|png)$!i", $URI)) { + error_404(); +} // ============================================================================ // BC: handle .php3 files that were renamed to .php @@ -90,11 +94,6 @@ elseif (preg_match("!^manual/(\\w+)/(print|printwn|html|tableless)(/)?$!", $URI, include $_SERVER['DOCUMENT_ROOT'] . "/manual/$parts[1]/index.php"; exit; } - -// Rediretion for printed page image displays -elseif (preg_match("!^manual/(\\w+)/(print|printwn|tableless)/figures/(.+)$!", $URI, $parts)) { - mirror_redirect("/manual/$parts[1]/figures/$parts[3]"); -} // ============================================================================ // Some nice URLs for getting something for download