mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 16:26:55 +02: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`.
|
`/etc/apache2/sites-available/default`.
|
||||||
|
|
||||||
```apache
|
```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
|
#These directives can be inside a virtual host or in the base server configuration
|
||||||
|
AllowEncodedSlashes On
|
||||||
Alias /librenms /opt/librenms/html
|
Alias /librenms /opt/librenms/html
|
||||||
|
|
||||||
<Directory "/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"]);
|
$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) {
|
foreach ($segments as $pos => $segment) {
|
||||||
$segment = urldecode($segment);
|
$segment = urldecode($segment);
|
||||||
|
|||||||
Reference in New Issue
Block a user