可以使用history.replaceState()方法来改变浏览器地址栏中的网址,让它显示跳转前的网址。例如:

history.replaceState(null, null, "https:\/\/www.ygbxheb.cn\/index1.html");

这将在浏览器地址栏中显示"https://www.ygbxheb.cn/index1.html",但实际上页面内容是跳转前的网址。

locationreplacehttpswwwygbxhebcnindex1html;改为locationhref = httpswwwygbxhebcnindex1html;后网址跳转后浏览器地址栏中的网址还是跳转后的新网址如果让它跳转后显示跳转前的网址

原文地址: https://www.cveoy.top/t/topic/h9xa 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录