[Vuejs]-Make webserver handle page refresh/bookmarks like Vue dev server

1👍

If you are using the router in History mode, you should set your server to serve the app accordingly. You can find both configurations for NGINX or APACHE in the router docs

Apache

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>

and for nginx:

nginx
location / {
  try_files $uri $uri/ /index.html;
}

Leave a comment