From 7928b4365b11d96ab928a2bc835c491e9de0cd5f Mon Sep 17 00:00:00 2001 From: Morgan Zolob Date: Tue, 19 Jun 2018 17:00:13 -0700 Subject: [PATCH] Allow Daux to work from sub-directories If you try to host Daux from any directory other than the root of a website (like mysite.com/docs, for example), it just gives an error that the page can't be found. This commit will make Daux remove the base directory from the request when handling it, which should make it work properly in sub-directories. --- libs/Server/Server.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/Server/Server.php b/libs/Server/Server.php index 6695686..d0c66cc 100755 --- a/libs/Server/Server.php +++ b/libs/Server/Server.php @@ -142,7 +142,7 @@ class Server { $this->params = $this->getParams(); - $request = substr($this->request->getRequestUri(), 1); + $request = substr($this->request->getRequestUri(), strlen($this->request->getBaseUrl()) + 1); if (substr($request, 0, 7) == 'themes/') { return $this->serveTheme(substr($request, 6));