How to rewrite URL address in web Front end

the background of the project with separate front and rear ends uses how to change the address
domain name / dist/xxx.html into domain name / dist/xxx if the PHP foreground does not use any framework.
is not a single-page project. NodeJS is not used.
I hope you can make a move.
what you are looking for on the Internet is a single page of routes. no, no, no. There"s nothing I can do about it. I have no choice but to ask for help from all the bigwigs

Mar.18,2021

var url = window.location.href;
console.log( url.split("//")[1].split(".html")[0] );

there are generally two ways to implement routing at the front end
hash: url/-sharp/ * . By listening to hash events, rendering the corresponding page
history: url/ * , html5's new api, can search for various single page application routing implementation principles (vue-router, react-router), etc. This method requires backend support. Redirect


each refresh.

you can use the location object of js to set url.
Code:
var url = window.location.href; / / take out the current url address
url = 'xxxx'; / / reset the address of the url jump
suggestion:
in general projects, the domain directory will be saved with a constant, and then the jump will be directly spliced.
example:

const contextPath = 'www.baidu.com/dist';

 
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d29a-2baec.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d29a-2baec.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?