2016-04-15 98 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中的片段標識符完全由客戶端處理。它們永遠不會發送到服務器,所以服務器無法訪問它們。