2016-04-15 96 views
0

我在html中设计了一个页面。我创建了多个链接(导航),并使用id指向同一页面部分。例如Next,这将显示下一节。点击链接时,它会更新URL(如localhost/myproject/index.html /#next)。但是,我需要在该URL中隐藏“#”。 (localhost/myproject/index.html/next)。我们正在使用nginx配置。怎么可能呢?在此先感谢...如何在nginx中隐藏#

+0

如果你使用angular试试这个[http://stackoverflow.com/questions/14319967/angularjs-routing-without-the-hash](http://stackoverflow.com/questions/14319967/angularjs-routing-without -Hash) – mygeea

+0

不,我使用普通的html – Gugan

+0

这是你在找什么? http://stackoverflow.com/questions/1397329/how-to-remove-the-hash-from-window-location-with-javascript-without-page-refresh和http://stackoverflow.com/questions/15322917/清除网址哈希。其他Quentin答案是正确的。 –

回答

2

这是不可能的。

URL中的片段标识符完全由客户端处理。它们永远不会发送到服务器,所以服务器无法访问它们。