I have a page that needs to load with a key as part of the URL, but this key has to be removed from the URL once the page has been loaded.
e.g.If the initia URL is http://localhost:1337/supplier/0AB3E8EA-D441-49D2-B467-165C11597F86 , it will change to http://localhost:1337/supplier
So now my issue is that if the user reloads the page it will reload http://localhost:1337/supplier and it will get a 404.
So Im trying to find out a way to append the Key back to URL before the page reloads and then once it has been loaded I remove the key again.
I have tried to change the window.location.href
on $(window).on('beforeunload', function(){})
but it doesnt work :(
Please help :) Thank you