当我尝试访问网站时,Vue 网站出现 404 错误。com/pagename

Vue Website give 404 error when i try to access with website.com/pagename

我正在学习 vue,firebase.I 刚刚在 build 之后将我的应用程序部署到 netlify 服务器上。一切正常,但我尝试使用页面名称直接访问我的网站,就像这是我的应用程序 To Vue。它有 5 页 signinsignuphomeglobalprofile404。当我像 https://vuefire-auth.netlify.app 这样打开主页时,我的应用程序打开并正常工作,但我尝试使用像 https://vuefire-auth.netlify.app/signup 这样的页面名称打开 netlify 给我 error.How 来处理它? 提前致谢。

在您的项目中创建一个包含以下内容的 _redirects 文件:

/*   /index.html   200

此规则确保每条路径都成功解析为 index.html 并且客户端可以完全控制路由逻辑。

阅读文章:Creating better, more predictable redirect rules for SPAs