Skip to content

Instantly share code, notes, and snippets.

@pauloelias
Created August 23, 2012 16:51
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 pauloelias/3438636 to your computer and use it in GitHub Desktop.
Save pauloelias/3438636 to your computer and use it in GitHub Desktop.
Simple ExpressionEngine .htaccess
# Standard ExpressionEngine Apache Configuration (.htaccess)
# httpd.apache.org/docs/2.2/mod/quickreference.html
# ------------------------------
# SECURITY: Secure "dot" files/directories
# ------------------------------
# Block access to "hidden" directories or files whose names begin with a
# period. This includes directories used by version control systems such as
# Subversion or Git.
# <IfModule mod_rewrite.c>
# RewriteCond %{SCRIPT_FILENAME} -d [OR]
# RewriteCond %{SCRIPT_FILENAME} -f
# RewriteRule "(^|/)\." - [F]
# </IfModule>
# Rewrite Magic
# ------------------------------
<IfModule mod_rewrite.c>
# RewriteEngine On
RewriteBase /
# INDEX: Standard ExpressionEngine Rewrite
# ------------------------------
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.*)$ /index.php/$1 [NC,R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment