From: Ardis Lu Date: Tue, 2 Aug 2022 07:15:57 +0000 (-0700) Subject: Simplify string X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=f9acc95d7ecaf607b8d89a486a5c68c1d7457474;p=ardislu.dev Simplify string --- diff --git a/script.js b/script.js index ba983e4..85b95b0 100644 --- a/script.js +++ b/script.js @@ -170,7 +170,7 @@ async function showPage(path) { // MUST redirect to a page where the web server serves an actual 404 error (i.e. not just // index.html again) otherwise this triggers an infinite loop document.title = '404: Not Found'; - location.replace(`${location.protocol}//${location.host}/errors/NotFound`); + location.replace(`${location.origin}/errors/NotFound`); } }