Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.3k views
in Technique[技术] by (71.8m points)

vue history模式下进入到index.html 404

访问页面http://xxx/xxx/index可以正常访问
但是访问http://xxx/xxx/index.html 就会跳到404
这个是怎么回事啊

:可不可以访问index.html也能进到首页


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

首先,你的项目是vue的
那么,index和index.html分别代表的不同路由,一个对一个错当然是正常的

想要index.html也能访问的话你可以把router内添加对应的页面映射就行了,也就是说index和index.html指向同一component


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...