Created
September 15, 2011 15:52
-
-
Save SamBenson/1219630 to your computer and use it in GitHub Desktop.
Our .htaccess boilerplate
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
ExpiresActive On | |
RewriteEngine on | |
RewriteBase / | |
# compress text, html, javascript, css, xml: | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/javascript | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css | |
AddOutputFilterByType DEFLATE application/xml | |
AddOutputFilterByType DEFLATE application/xhtml+xml | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/x-javascript | |
# Expires 1 month after file is first accessed | |
ExpiresByType image/jpeg A2592000 | |
ExpiresByType image/jpg A2592000 | |
ExpiresByType image/gif A2592000 | |
ExpiresByType image/png A2592000 | |
ExpiresByType image/x-icon A2592000 | |
ExpiresByType text/plain A2592000 | |
# Expires 1 month after file is modified | |
ExpiresByType application/x-javascript M2592000 | |
ExpiresByType text/css M2592000 | |
ExpiresByType text/javascript M2592000 | |
ExpiresByType text/html M2592000 |
No problem - for new installations don't forget to hit a2enmod expires
first!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this. Good to have in the toolbox.