From ddfe8bf8a7e2b2e3c0a572e7eac3fca9392db14d Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 2 Sep 2024 19:25:21 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/share/httpd/default/js/errorpages/homepage.js --- .../httpd/default/js/errorpages/homepage.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/rootfs/usr/share/httpd/default/js/errorpages/homepage.js b/rootfs/usr/share/httpd/default/js/errorpages/homepage.js index bd3925d..b52be9f 100644 --- a/rootfs/usr/share/httpd/default/js/errorpages/homepage.js +++ b/rootfs/usr/share/httpd/default/js/errorpages/homepage.js @@ -1,6 +1,16 @@ -function homepage() { - let proto = location.protocol; +function homepage(getURI) { + let baseURI = getURI; let port = location.port; - let currentSite = window.location.hostname; - window.location = proto + '//' + currentSite + ':' + port; + let url = location.hostname; + let proto = location.protocol; + let baseURL = baseURI || location.pathname; + let base = baseURL.slice(0, baseURL.lastIndexOf('/')); + if (!base) base = '/'; + if (!port) + if (proto == 'https:') { + port = 443; + } else { + port = 80; + } + window.location = proto + '//' + url + ':' + port + base; }