123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <?php
- require_once '../include/prepend.php';
- function make404() {
-
- header('HTTP/1.0 404 Not Found');
-
- commonHeader('404 Not Found');
-
- echo "<H1>Not Found</H1>\n";
- echo "<P>The page <B>" . htmlspecialchars($_SERVER['REQUEST_URI']) . "</B> could not be found.</P>\n";
-
- commonFooter();
- }
- if (file_exists("../configuration.inc")) {
- include_once "../configuration.inc";
- }
- $ri = htmlspecialchars($_SERVER['REQUEST_URI']);
- if (preg_match('/\.(pdf|gif|jpg)$/', $_SERVER['REQUEST_URI'])) {
-
- make404();
- exit;
- }
- $lang = "en";
- if (!is_dir("{$_SERVER['DOCUMENT_ROOT']}/manual1/$lang")) {
- $lang = "en";
- }
- if (preg_match("/(.*\.php)3$/", $ri, $array)) {
- if($_SERVER['SERVER_PORT']!=80) {
- $url = "http://".$_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT'].$array[1];
- } else {
- $url = "http://".$_SERVER['SERVER_NAME'].$array[1];
- }
- $urle = htmlspecialchars($url);
- header("HTTP/1.0 302 Redirect");
- header("Location: $url");
- print "<html><title>Redirect to $urle</title><body>";
- print "<a href=\"".$url."\">Please click here</a></body></html>";
- exit;
- }
- if (eregi("^(.*)/manual1/((html/)?[^/]+)$", $ri, $array)) {
-
- if($_SERVER['SERVER_PORT']!=80) {
- $url = "http://".$_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT']."$array[1]/manual1/$lang/".$array[2];
- } else {
- $url = "http://".$_SERVER['SERVER_NAME']."$array[1]/manual1/$lang/".$array[2];
- }
-
- $urle = htmlspecialchars($url);
-
- header("HTTP/1.0 302 Redirect");
-
- header("Location: $url");
-
- print "<html><title>Redirect to $urle</title><body>";
- print "<a href=\"".$url."\">Please click here</a></body></html>";
- exit;
- }
- $uri = substr($REDIRECT_REDIRECT_ERROR_NOTES,
- strpos($REDIRECT_REDIRECT_ERROR_NOTES,
- $_SERVER['DOCUMENT_ROOT']
- ) + strlen($_SERVER['DOCUMENT_ROOT']) + 1
- );
- require "../include/manual1-lookup.inc";
- if(strchr($uri, '/')) {
-
- list($lang, $function) = explode('/', $uri, 2);
- $function = strtolower($function);
- $lang = strtolower($lang);
- } else {
- $function = strtolower($uri);
- }
- $try = find_manual_page($lang, $function);
- if($try) {
-
- header("HTTP/1.0 302 Redirect");
-
- header("Location: $try");
- exit;
- }
- make404();
- exit;
- ?>
|