Created
August 19, 2016 16:53
-
-
Save Sysetup/822f238b97388f91ed57178d5a5b3f8d to your computer and use it in GitHub Desktop.
Remove .html from url in a static website
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
var url = window.location.href; | |
url = url.split('.html')[0]; | |
//url = url.substring(0, url.lastIndexOf(".")); | |
window.history.replaceState( null, null, url ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much!