Created
March 9, 2016 16:36
-
-
Save joshdcomp/3683a9e127b4c259d3a1 to your computer and use it in GitHub Desktop.
.htaccess for one-page web apps: redirect everything except requests for filenames ending in `.png, .jpg, .gif, .jpeg, .bmp, .js, .css, or .svg` (you can add more to that list where you see those file endings)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.html$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !(\.png|\.jpg|\.gif|\.jpeg|\.bmp|\.js|\.css|\.svg)$ | |
RewriteRule ^(.*) /index.html [L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment