diff --git a/app/js/custom.js b/app/js/custom.js index bd067368..e3957ea4 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -145,8 +145,11 @@ function setCSRFTokenHeader(event, xhr, settings) { } function contentLoaded() { - pageCurrent = window.location.href.split("?")[1].split("=")[1]; - pageCurrent = pageCurrent.replace("#",""); + //pageCurrent = window.location.href.split("?")[1].split("=")[1]; + //pageCurrent = pageCurrent.replace("#",""); + + pageCurrent = window.location.href.split("/").pop(); + switch(pageCurrent) { case "network_conf": getAllInterfaces(); diff --git a/config/50-raspap-router.conf b/config/50-raspap-router.conf new file mode 100644 index 00000000..c6ac9a04 --- /dev/null +++ b/config/50-raspap-router.conf @@ -0,0 +1,9 @@ +server.modules += ( + "mod_rewrite", +) + +$HTTP["url"] =~ "^/(?!(dist|app|ajax)).*" { + url.rewrite-once = ( + "^/[^\?]*(\?.*)?" => "/index.php$1" + ) +} diff --git a/index.php b/index.php index ca55c5ce..1efa7733 100755 --- a/index.php +++ b/index.php @@ -48,7 +48,8 @@ require_once 'includes/openvpn.php'; require_once 'includes/torproxy.php'; $output = $return = 0; -$page = $_GET['page']; +//$page = $_GET['page']; +$page = $_SERVER['REQUEST_URI']; $theme_url = getThemeOpt(); $toggleState = getSidebarState(); @@ -107,7 +108,7 @@ $bridgedEnabled = getBridgedState();