How to fix the bug of reloading the page when you use history.pushState API?

Hi.
pushState writes into the address bar of the link and when I reload the page the browser is redirected to the non-existent link. How to avoid it, as to the moment when the browser started to reload the page to change the position in the browser history?
April 19th 20 at 12:37
1 answer
April 19th 20 at 12:39
Solution
but why change the url, if there is no handler for a new url?
changing something that people have been able to copy the link and then immediately get to where you need

("How to avoid it": I think that in any way)
Prompt how to implement a handler for the new url? - leann_Jaskolski commented on April 19th 20 at 12:42
@leann_Jaskolski, this is done on the server side. Response, respectively, depends on your server software. - zella_Schulist19 commented on April 19th 20 at 12:45
@zella_Schulist19using WordPress - leann_Jaskolski commented on April 19th 20 at 12:48
@leann_Jaskolski, keywords: wordpress spa routing. - zella_Schulist19 commented on April 19th 20 at 12:51
@zella_Schulist19, Thank you - leann_Jaskolski commented on April 19th 20 at 12:54

Find more questions by tags FrontendJavaScript