From ab179e0bed77bff0059176641c493be191d33f8f Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 2 Sep 2024 19:25:43 -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 htdocs/www/js/errorpages/homepage.js --- htdocs/www/js/errorpages/homepage.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/www/js/errorpages/homepage.js b/htdocs/www/js/errorpages/homepage.js index bd3925d..b52be9f 100644 --- a/htdocs/www/js/errorpages/homepage.js +++ b/htdocs/www/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; }