I rewrite URL like this,
history.pushState('data', '', 'http://radyospor.fstats.net/Galatasaray-Bursa');
Everything is good but after rewrite url when refresh page I get to:
"HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
How can I solve it?
Let's say your home page is at this URL: http://radyospor.fstats.net/
When you browse to that URL, the server returns the index.html
file which is found in its web root.
When you call history.pushState
, there is no call to the server but the URL is changed.
When you refresh after history.pushState
, the URL is now http://radyospor.fstats.net/Galatasaray-Bursa
which the server interprets as a request to a file named Galatasaray-Bursa
in the web root directory.
This file does not exist, so you get a 404.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.