mirror of
https://github.com/klokantech/tileserver-php.git
synced 2025-08-03 21:27:52 +02:00
Some changes of router for better running without htaccess.
This commit is contained in:
@@ -1359,6 +1359,9 @@ class Router {
|
|||||||
$path_info = $_SERVER['PATH_INFO'];
|
$path_info = $_SERVER['PATH_INFO'];
|
||||||
} else if (!empty($_SERVER['ORIG_PATH_INFO']) && $_SERVER['ORIG_PATH_INFO'] !== '/tileserver.php') {
|
} else if (!empty($_SERVER['ORIG_PATH_INFO']) && $_SERVER['ORIG_PATH_INFO'] !== '/tileserver.php') {
|
||||||
$path_info = $_SERVER['ORIG_PATH_INFO'];
|
$path_info = $_SERVER['ORIG_PATH_INFO'];
|
||||||
|
} else if (!empty($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'],'/tileserver.php') !== false) {
|
||||||
|
$path_info = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||||
|
$config['baseUrls'][0] = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '?';
|
||||||
} else {
|
} else {
|
||||||
if (!empty($_SERVER['REQUEST_URI'])) {
|
if (!empty($_SERVER['REQUEST_URI'])) {
|
||||||
$path_info = (strpos($_SERVER['REQUEST_URI'], '?') > 0) ? strstr($_SERVER['REQUEST_URI'], '?', true) : $_SERVER['REQUEST_URI'];
|
$path_info = (strpos($_SERVER['REQUEST_URI'], '?') > 0) ? strstr($_SERVER['REQUEST_URI'], '?', true) : $_SERVER['REQUEST_URI'];
|
||||||
@@ -1401,10 +1404,11 @@ class Router {
|
|||||||
$handler_instance = $discovered_handler();
|
$handler_instance = $discovered_handler();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo 'Router: No route';
|
if(!isset($config['baseUrls'][0])){
|
||||||
die;
|
$config['baseUrls'][0] = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '?';
|
||||||
//$handler_instance = new Server;
|
}
|
||||||
//$handler_instance->getHtml();
|
$handler_instance = new Server;
|
||||||
|
$handler_instance->getHtml();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user