1
的前面删除哈希我创建了一个简单的应用程序与骨干和木偶。它的工作正常,没有错误或类似的东西。但是,当我看到URL,它在网址前面的哈希,这里是我的链接主干:从网址
programming/index.html#chart
programming/index.html#tutorial/3
programming/index.html#tutorial/6
我想使它更清洁,更可读,我想删除hastag和/
所以URL看起来像更换这
programming/index.html/chart
programming/index.html/tutorial/3
programming/index.html/tutorial/6
,并且可以访问这也
programming/chart
programming/tutorial/3
programming/tutorial/6
我想太多这个问题的答案
Routing in Backbone.js/Marionette.js - no hashtags, route list and sub-routers
BackboneJS - Router issues - how to get clean URL's
我试图让pushState的为真,这样
programming.on('start',function(){
if(Backbone.history){
Backbone.history.start({
pushState : true
});
if(this.getCurentRoute() === ""){
programming.trigger("program:list")
}
}
})
我试图让.htaccess文件
<IfModule mod_rewrite.c>
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /#$1 [R,L,NE]
</IfModule>
但他们都不适合我:(请大家帮我。
我不认为你可以做到这一点,因为如果你删除散列,那么它会去服务器端路由而不是客户端路由,你需要散列非HTML5浏览器 –