Skip to content

Instantly share code, notes, and snippets.

@LoyEgor
Last active June 22, 2017 15:44
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 LoyEgor/209a904b4a87b068bd9104b128e23bc7 to your computer and use it in GitHub Desktop.
Save LoyEgor/209a904b4a87b068bd9104b128e23bc7 to your computer and use it in GitHub Desktop.
basic .htaccess (www redirect, gzip, 7 day changes)
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
FileETag MTime Size
<ifmodule mod_expires.c>
<filesmatch ".(jpg|gif|png|css|js|swf|svg|woff|woff2|ttf|eot)$">
ExpiresActive on
ExpiresDefault "access plus 7 day"
</filesmatch>
</ifmodule>
<IfModule mod_headers.c>
<FilesMatch ".(js|css)$">
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment