New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vue的history模式下,部署到tomcat服务,输入 非首页路径 而页面空白的问题,有办法解决吗 #4141
Comments
看看资源引用路径,是不是打包出问题了 |
打包没问题了
比如我正常可以访问www.index.com,里面页面跳转没问题
但是我如果访问www.index.com/a页面就不行,因为vue打完包只有一个html文件,tomcat去找这个a.html页面文件就找不到
|
我查到了SEO优化的方法,但是我试了十几个小时,就是打包不成功,提示报错:[prerender-spa-plugin] Unable to prerender all routes |
history要在服务端做配合的。简单地说就是把所有请求到导向 index.html 入口。vue 的文档中有说明,tomcat 我不太熟悉。 |
我知道这个全部重定向到首页,只是单纯防止跳转空白 |
可以的,优先跳转到存在的页面,都不匹配才重定向到 index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Question(提问)
Steps to reproduce(问题复现步骤)
Screenshot or Gif(截图或动态图)
Link to minimal reproduction(最小可在线还原demo)
Other relevant information(格外信息)
The text was updated successfully, but these errors were encountered: