Skip to content

Instantly share code, notes, and snippets.

@jhaus
Created November 22, 2011 09:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhaus/1385270 to your computer and use it in GitHub Desktop.
Save jhaus/1385270 to your computer and use it in GitHub Desktop.
Simple Apache rewrite for index.html to the root url. Source/discussion: http://www.webmasterworld.com/google/3105248.htm
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} ^.*\/index\.html?
RewriteRule ^(.*)index\.html?$ http://example.com$1 [R=301,L]
# More resources:
#
# http://old.justinshattuck.com/2007/01/19/apache-mod_rewrite-cheat-sheet/
# http://net.tutsplus.com/tutorials/other/a-deeper-look-at-mod_rewrite-for-apache/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment