好了,所以這個問題是這樣的:Angular.js html5mode(true)和普通錨點href鏈接?
我想有這樣http://www.domain.com/bla沒有http://www.domain.com/#/bla
的URL我解決了使用html5mode(真)。非常適合我!
但現在當用戶進入(直接在地址欄鍵入它爲例)//www.domain.com/bla他將沒有顯示,因爲角只是URL重寫,在加載#網址。所以實際上//www.domain.com/bla不存在爲url。
我的問題是,我該怎麼讓頁面//www.domain.com/#/bla當用戶進入//www.domain.com/bla?(這必須從後端進行,在我的情況node.js)
我認爲這與它有關//github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server -to-工作與-html5mode
但這是UI的路由器,我想,以避免它。
你在使用UI.router嗎? – 2014-10-11 22:30:52
我正在使用角度路由器。 – 2014-10-12 08:16:17
你可以發佈你使用的代碼嗎? HTML和角度。 – 2014-10-12 12:25:32