From 0678acedc458161388c8fb5d9f726a821abf275a Mon Sep 17 00:00:00 2001 From: Daniel Leong Date: Sun, 13 Dec 2020 09:48:06 -0500 Subject: [PATCH] Adjust 404.html-based URL rewrite to work more generally Now, any non-github pages URL will use segmentCount = 0. Anyone hosting this as an org page (instead of a user page, like I'm doing right now) will have to tweak it further... --- resources/public/404.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/public/404.html b/resources/public/404.html index 1336d797..b7a5cb6f 100644 --- a/resources/public/404.html +++ b/resources/public/404.html @@ -11,9 +11,9 @@ // If you're creating a Project Pages site and NOT using a custom domain, // then set segmentCount to 1 (enterprise users may need to set it to > 1). // Otherwise, leave segmentCount as 0. - var segmentCount = 1; + var segmentCount = 0; var l = window.location; - if (l.hostname === 'localhost') segmentCount = 0; + if (l.hostname.match(/github\.io$/)) segmentCount = 1; l.replace( l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +