用vue init webpack写了个vue的router
跳转到:http://localhost:8080/#ratings/
上面这个是正常切换到ratings了
但是当我手动修改url为:
http://localhost:8080/ratings#/
的时候为什么是主页?
而且http header的Request URL是http://localhost:8080/ratings
这就奇怪了啊! 按理说localhost:8080/ratings这个路径上没有html文档的, 那不是应该报404错误码吗? 怎么会跳到主页了呢?
因为你开启了(vue-cli自带的配置)开启了historyFallback功能,所有的404请求都将"重定向"到index.html