Last active
October 5, 2021 16:57
-
-
Save bencao/f25ad9af3115781dd2b460ecf0245db0 to your computer and use it in GitHub Desktop.
redirect if url does not end with slash
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
if (window && window.location && !window.location.href.endsWith("/")) { | |
window.location = window.location.href + "/"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment