How to remove hashbang #! from url ?
How to remove hashbang #! from url ?
Set mode to ‘history’
const router = new VueRouter({ mode: 'history' })
Your server must configured to handle these links, through, https://router.vuejs.org/guide/essentials/history-mode.html
Another approach to remove hashbang
window.router = new VueRouter({ hashbang: false, //abstract: true, history: true, mode: 'html5', linkActiveClass: 'active', transitionOnLoad: true, root: '/' });
Apache server should be properly configured and rewrite the url
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] </IfModule>