Last active
August 29, 2015 14:01
-
-
Save rhinkle/f2896bb8e0e55ca82e6b to your computer and use it in GitHub Desktop.
Media Temple Site live .httaccess
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
<IfModule mod_expires.c> | |
# Enable expirations | |
ExpiresActive On | |
# Default directive | |
ExpiresDefault "access plus 1 month" | |
# My favicon | |
ExpiresByType image/x-icon "access plus 1 year" | |
# Images | |
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" | |
# CSS | |
ExpiresByType text/css "access 1 month" | |
# Javascript | |
ExpiresByType application/javascript "access plus 1 year" | |
</IfModule> | |
<IfModule mod_deflate.c> | |
#The following line is enough for .js and .css | |
AddOutputFilter DEFLATE js css | |
#The following line also enables compression by file content type, for the following list of Content-Type:s | |
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml | |
#The following lines are to avoid bugs with some browsers | |
BrowserMatch ^Mozilla/4 gzip-only-text/html | |
BrowserMatch ^Mozilla/4\.0[678] no-gzip | |
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html | |
</IfModule> | |
<IfModule mod_headers.c> | |
<FilesMatch "\.(js|css|xml|gz)$"> | |
Header append Vary: Accept-Encoding | |
</FilesMatch> | |
</IfModule> | |
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$"> | |
Header unset ETag | |
FileETag None | |
</FilesMatch> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you will need for digital ocean
sudo a2enmod headers
sudo a2enmod expires