Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save magnum/e69d34d0e9ebabcbe12ada94c78e9549 to your computer and use it in GitHub Desktop.
Save magnum/e69d34d0e9ebabcbe12ada94c78e9549 to your computer and use it in GitHub Desktop.
Apache .htaccess settings for Vue, vue-router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations
@magnum
Copy link
Author

magnum commented Oct 6, 2023

if you have subfolder

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment