Skip to content

Instantly share code, notes, and snippets.

@benjamin-smith
Created March 15, 2013 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjamin-smith/5170246 to your computer and use it in GitHub Desktop.
Save benjamin-smith/5170246 to your computer and use it in GitHub Desktop.
#ExpressionEngine .htaccess
RedirectMatch 403 /\.svn.*$
RedirectMatch 403 /\.git.*$
<Files ~ ".htaccess|README|readme.md|\.(sql)|.gitignore|Capfile|Gemfile|Guardfile|Rakefile|config.rb$">
order allow,deny
deny from all
</Files>
Options All -Indexes
# ----------------------------------------------------------------------
# Suppress or force the "www." at the beginning of URLs
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>
# ----------------------------------------------------------------------
# EE enable friendly URLs
# ----------------------------------------------------------------------
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/?$1 [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment