1
0
mirror of https://github.com/klokantech/tileserver-php.git synced 2025-08-03 05:07:48 +02:00

Some changes of router for better running without htaccess.

This commit is contained in:
Dalibor Janák
2014-05-19 17:55:00 +02:00
parent 4cd86eefc3
commit cd5cd44e75

View File

@@ -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,11 +1404,12 @@ 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();
} }
}
} }