Skip to content

Instantly share code, notes, and snippets.

@joshuabaker
Created August 17, 2012 15:58
Show Gist options
  • Save joshuabaker/3380134 to your computer and use it in GitHub Desktop.
Save joshuabaker/3380134 to your computer and use it in GitHub Desktop.
ExpressionEngine .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
# Prevent access to system directory
RewriteRule ^/?system - [F]
# Prevent access to member pages
RewriteRule ^(index.php)?/?member - [F]
# Removes index.php
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
# If 404s, "No Input File" or every URL returns the same thing
# make it /index.php?/$1 above (add the question mark)
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment