Created
December 16, 2011 21:06
-
-
Save ryanbattles/1487976 to your computer and use it in GitHub Desktop.
A Standard .htaccess for use on most ExpressionEngine sites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FileETag None | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Force www | |
RewriteCond %{HTTP_HOST} ^example.com$ [NC] | |
RewriteRule ^(.*)$ http://www.example.com$1 [R=301,L] | |
# Uncomment to Remove www, but comment the above 2 lines out. :) | |
# Otherwise the world will end | |
# RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] | |
# RewriteRule ^(.*)$ http://example.com$1 [R=301,L] | |
# 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 or "No Input File" errors, or every page give the same thing | |
# make it /index.php?/$1 above -- Just adding the question mark | |
</IfModule> | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType text/html "access plus 1 second" | |
ExpiresByType text/css "access plus 1 month" | |
ExpiresByType image/gif "access plus 1 month" | |
ExpiresByType image/png "access plus 1 month" | |
ExpiresByType image/jpg "access plus 1 month" | |
ExpiresByType image/jpeg "access plus 1 month" | |
ExpiresByType text/javascript "access plus 1 month" | |
ExpiresByType application/pdf "access plus 1 month" | |
ExpiresByType application/x-download "access plus 1 month" | |
ExpiresByType application/x-javascript "access plus 1 month" | |
ExpiresByType application/x-shockwave-flash "access plus 1 month" | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment