+ if ($path == '') {
+ //we need a / to get the relative links on index.php work
+ if (!isset($_SERVER['REQUEST_SCHEME'])) {
+ $_SERVER['REQUEST_SCHEME'] = 'http';
+ }
+ $url = $_SERVER['REQUEST_SCHEME'] . '://'
+ . $_SERVER['HTTP_HOST']
+ . preg_replace('/[?#].*$/', '', $_SERVER['REQUEST_URI'])
+ . '/';
+ header('Location: ' . $url);
+ exit(0);
+ } else if( $path == '/') {