comparison index.php @ 7:c4046c7e1f5a

Missing one part when removing current_dir.
author edogawaconan <me@myconan.net>
date Tue, 21 Oct 2014 21:46:37 +0900
parents 8df269a2efd8
children ac946673f830
comparison
equal deleted inserted replaced
6:8df269a2efd8 7:c4046c7e1f5a
20 $root = $_SERVER["DL_ROOT"]; 20 $root = $_SERVER["DL_ROOT"];
21 if ($root === null || $root === "") { $root = $_SERVER["DOCUMENT_ROOT"]; } 21 if ($root === null || $root === "") { $root = $_SERVER["DOCUMENT_ROOT"]; }
22 22
23 if (realpath($root . $path) === false) { 23 if (realpath($root . $path) === false) {
24 header("HTTP/1.0 404 Not Found"); 24 header("HTTP/1.0 404 Not Found");
25 } elseif (substr($current_dir, -1) !== "/") { 25 } elseif (substr($path, -1) !== "/") {
26 header("Location: " . $path . "/", false, 301); 26 header("Location: " . $path . "/", false, 301);
27 } 27 }
28 28
29 if (http_response_code() !== 200) { exit; } 29 if (http_response_code() !== 200) { exit; }
30 30