# If mod_rewrite.c is enabled
<IfModule mod_rewrite.c>
# Enable Rewrite Engine
RewriteEngine On
# Redirect closing-slash requests if not a folder
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# All request redirect to ./index.html
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [L]
</IfModule>
Last active
December 10, 2022 10:15
-
-
Save rozsazoltan/d010f615e5be75aeb3f13dcfccbbae1e to your computer and use it in GitHub Desktop.
All request redirect to index.html (important in JavaScript applications - Vue, React, Preact, Svelte, ...)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment