1
0
mirror of https://github.com/php/web-php.git synced 2026-03-24 07:12:16 +01:00

Put this image redirectio to the right place

This commit is contained in:
Gabor Hojtsy
2003-11-07 18:20:43 +00:00
parent 8ff38ecfa2
commit 429422d91f

View File

@@ -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