【发布时间】:2018-11-18 03:50:46
【问题描述】:
我的 url 看起来像 http://localhost/dashboard/index.php?id=1,这样我就可以根据使用情况传递 url 中的值并相应地切换仪表板。我想要的只是 url 应该像 http://localhost/dashboard/index.php 甚至 http://localhost/dashboard/index.php/1 一样可见。我想隐藏或替换一个 url 字符串(为了可见性)而不是重定向我尝试使用 htaccess。我们可以使用 JavaScript 做到这一点吗??
【问题讨论】:
-
你需要一些服务器端的魔法,更改
dicument.location.search属性会重新加载页面 -
可以使用htaccess实现
标签: javascript php url replace