我有一个网站anandchowdhary.com/,这是一个单页面的网站;我有像anandchowdhary.com#about和anandchowdhary.com/#contact这样的部分,但我希望地址栏看起来像http://anandchowdhary.com/about或http://anandchowdhary.com/contact。
我搜索了一下,了解到这样的事情可以用htaccess来做,但我不知道该怎么做。有什么帮助吗?
发布于 2012-11-13 20:11:27
使用Javascript加载页面后,可以重写URL
$(document).ready(function() {
// On click action
window.history.pushState(null, "Title", "/new-url");
});这将在不重新加载的情况下更改URL。并为htaccess的每个链接添加以下内容,以使反向条件起作用,
RedirectMatch 301 ^/about/$ http://anandchowdhary.com/#abouthttps://stackoverflow.com/questions/13359988
复制相似问题