Answer the question
In order to leave comments, you need to log in
Problems with a Vue project in production?
Hello ladies and gentlemen.
During my development as a front-end developer, I decided to learn vue. started making my first project on vue + vuex + vuetify (and of course webpack).
Everything is beautiful on the girl. animations, other nonsense. I decided to test this case in the sale. uploaded my code to the server.
The main page opens. page transitions are made. but if you refresh the page while on any other link, for example my.site/about, the server returns 404. Who knows how such problems are solved? (I repeat, there is no such problem on the virgin)
Answer the question
In order to leave comments, you need to log in
Here it is directly in Russian in the documentation :
However, there is a problem: since our application is a single page application, without configuring the server properly, we will cause users to receive a 404 error if they go to oursite.com/user/id directly. Now this is not to be called beautiful.
Do not rush to get upset: all you need is a single "backup" entry in the server configuration. If the URL does not match any static file, the server should simply return index.html, which is where our application lives. And again, great!
The config on the server must be set to always give the index.html file.
For any route.
Hash routing done?
ErrorDocument 404 / this entry solved all the issues. thanks for the hint.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question