mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
check for sites where there is no subdirectory
This commit is contained in:
@@ -4,10 +4,8 @@ container of your choosing. If using a virtual host, place the directives in the
|
||||
`/etc/apache2/sites-available/default`.
|
||||
|
||||
```apache
|
||||
#This directive is never put inside a virtual host
|
||||
AllowEncodedSlashes On
|
||||
|
||||
#These directives can be inside a virtual host or in the base server configuration
|
||||
AllowEncodedSlashes On
|
||||
Alias /librenms /opt/librenms/html
|
||||
|
||||
<Directory "/opt/librenms/html">
|
||||
|
||||
@@ -11,9 +11,14 @@ foreach ($_GET as $key => $get_var) {
|
||||
}
|
||||
}
|
||||
|
||||
$segments = explode('/', trim($_SERVER['REQUEST_URI'], '/'));
|
||||
$base_url = parse_url($config["base_url"]);
|
||||
$segments = explode('/', trim(str_replace($base_url["path"], "", $_SERVER['REQUEST_URI']), '/'));
|
||||
// don't parse the subdirectory, if there is one in the path
|
||||
if (strlen($base_url["path"]) > 1) {
|
||||
$segments = explode('/', trim(str_replace($base_url["path"], "", $_SERVER['REQUEST_URI']), '/'));
|
||||
}
|
||||
else {
|
||||
$segments = explode('/', trim($_SERVER['REQUEST_URI'], '/'));
|
||||
}
|
||||
|
||||
foreach ($segments as $pos => $segment) {
|
||||
$segment = urldecode($segment);
|
||||
|
||||
Reference in New Issue
Block a user