Home > Back-end >  Vue Website give 404 error when i try to access with website.com/pagename
Vue Website give 404 error when i try to access with website.com/pagename

Time:03-01

I am learning vue and firebase.I just deployed my app on netlify server after build.All ok but i try to directly access my site with page name like this is my app To Vue.It have 5 pages signin, signup, home, global, profile and 404. My app open and work correctly when i open home like like https://vuefire-auth.netlify.app but i try to open with page name like https://vuefire-auth.netlify.app/signup netlify give me error.How to handle it? Thanks in advance.

CodePudding user response:

Create a _redirects file in your project with the following content:

/*   /index.html   200

This rule ensures that every path successfully resolves to index.html and the client has full control over the routing logic.

Read article: Creating better, more predictable redirect rules for SPAs

  • Related