mirror of
https://github.com/dockersrc/scripts
synced 2024-11-21 23:23:05 -05:00
ab179e0bed
htdocs/www/js/errorpages/homepage.js
17 lines
430 B
JavaScript
17 lines
430 B
JavaScript
function homepage(getURI) {
|
|
let baseURI = getURI;
|
|
let port = location.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;
|
|
}
|