-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: replaced overly complicated redirection rules with a simple hack
- Loading branch information
1 parent
8c20b47
commit 31e0bdd
Showing
4 changed files
with
26 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// This is a very hack to force a trailing slash in case the URL does not point | ||
// directly to an html document. | ||
// | ||
// Netlify doesnt allow changing trailing slashes manually so we have to do | ||
// it this way. | ||
if (!window.location.pathname.endsWith(".html") && | ||
!window.location.pathname.endsWith("/")) { | ||
var url = window.location.protocol + '//' + | ||
window.location.host + | ||
window.location.pathname + '/' + | ||
window.location.search; | ||
|
||
if(window.history && window.history.replaceState) { | ||
window.history.replaceState(null, document.title, url); | ||
} else { | ||
window.location = url | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters