I just deploy my vue js project to apache server. My file /dist
located in /var/www/html/dist
. When i visit the page it’s work fine. But when i visit in another page and i refresh the page, in browser say 404 Not found. How can i fix this ?
I just deploy my vue js project to apache server. My file /dist
located in /var/www/html/dist
. When i visit the page it’s work fine. But when i visit in another page and i refresh the page, in browser say 404 Not found. How can i fix this ?
2
Answers
You need a configuration something similar to this:
It will automatically serve
index.html
file for every request that doesn’t have a corresponding static file. You will have to put this.htaccess
file. The use ofIfModule
is explained here.I have same error, on ubuntu after i install apache.
First i added in /etc/apache2/apache2.conf
AllowOverride All
In /etc/apache2/sites-available
Then in console activate rewrite module and restart apache