Skip to content

Instantly share code, notes, and snippets.

@vogdb
Forked from abdelfattahradwan/.htaccess
Created April 12, 2023 06:25
Show Gist options
  • Save vogdb/db952c61e0cf71cbd606e1ad554792c9 to your computer and use it in GitHub Desktop.
Save vogdb/db952c61e0cf71cbd606e1ad554792c9 to your computer and use it in GitHub Desktop.
.htaccess File for SvelteKit Single-Page-Applications
# Rewrite non /app/build/ requests to /app/build/
RewriteCond %{REQUEST_URI} !^/app/build/
RewriteRule ^(.*)$ /app/build/$1 [L]
# Rewrite requests to non-existing files/dirs to /app/build/index.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /app/build/index.html [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment