Skip to content

Instantly share code, notes, and snippets.

@usefulthink
Created September 30, 2011 10:37
Show Gist options
  • Save usefulthink/1253397 to your computer and use it in GitHub Desktop.
Save usefulthink/1253397 to your computer and use it in GitHub Desktop.
rewrite /*.html -> /*/
RewriteEngine On
# alles, was keine datei ist, auf .html endet und nicht index.html ist...
RewriteCond ${REQUEST_FILENAME} !-f
RewriteCond ${REQUEST_FILENAME} \.html$
RewriteCond ${REQUEST_FILENAME} !^index\.html$
# ... umschreiben zu /.../ und redirecten
RewriteRule ^(.*)\.html$ /$1/ [R=301,QSA,L]
# alles andere an index.php anhängen...
RewriteCond ${REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment