How to change hashbang url to history API

2019-04-10 03:23发布

I'm using ember1.0-rc3, i want to change hashbang urls into normal url format (ie, www.site.com/admin#/page1 to www.site.com/admin/page1).In order to make this change,i use location: "history" in app router.

But when i reload a page or bookmark a page doesn't works, it redirects to home page only.I want the options reload and bookmark in my app, without changing redirect urls in .htaccess file.Is there any way for it?Thanks in advance

1条回答
贼婆χ
2楼-- · 2019-04-10 04:10

In order to use HTML5 history with a single page app like ember, your server must be have the behavior of rendering your main index.html file for any URL. The Ember router has the logic to look at the URL when it loads and go to the correct route.

查看更多
登录 后发表回答