Skip to content

Instantly share code, notes, and snippets.

@oneup
Created December 10, 2009 14:01
Show Gist options
  • Save oneup/253347 to your computer and use it in GitHub Desktop.
Save oneup/253347 to your computer and use it in GitHub Desktop.
apache2 redirect everything to index.html prevent loop
# apache 2 mod_rewrite no infinite redirect loops
RewriteEngine on
# still keep /static folder
RewriteCond %(REQUEST_URI) !^(\/static) [NC]
# don't rewrite index.html (prevents infinite loop)
RewriteRule !index\.html - [C]
# rewrite everything to index
RewriteRule .* /index.html [R]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment