Skip to content

Commit

Permalink
Adjust 404.html-based URL rewrite to work more generally
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
dhleong committed Dec 13, 2020
1 parent 2da8041 commit 0678ace
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '') +
Expand Down

0 comments on commit 0678ace

Please sign in to comment.