Skip to content

Instantly share code, notes, and snippets.

@davidmars
Created October 22, 2024 11:26
Show Gist options
  • Save davidmars/0a2c5b4bc201a3e3c592bd7019a3900a to your computer and use it in GitHub Desktop.
Save davidmars/0a2c5b4bc201a3e3c592bd7019a3900a to your computer and use it in GitHub Desktop.
Very very open minded .htaccess for vue, vue router & apache
# vue router open minded .htaccess
# abcd/assets/efgh.ext -> assets/efgh.ext
# abcd/efgh/ijk-what-else -> index.html
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)assets/(.*)$ assets/$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.html [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment