Skip to content

Instantly share code, notes, and snippets.

@simbus82
Created July 19, 2019 16:59
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 simbus82/9d0e6f80866bf2f8f366d77d47b4ba73 to your computer and use it in GitHub Desktop.
Save simbus82/9d0e6f80866bf2f8f366d77d47b4ba73 to your computer and use it in GitHub Desktop.
.htaccess for cookie-less image domain
AddDefaultCharset UTF-8
ServerSignature Off
Options -Indexes
FileETag none
<IfModule mod_headers.c>
Header unset ETag
Header unset Cookie
Header unset Set-Cookie
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
</IfModule>
<FilesMatch "\.(ico|jpg|jpeg|jpe|png|gif)$">
ExpiresDefault "access plus 2 years"
</FilesMatch>
<IfModule mod_expires.c>
ExpiresByType image/x-icon "access plus 2 years"
ExpiresByType image/ico "access plus 2 years"
ExpiresByType image/gif "access plus 2 years"
ExpiresByType image/jpg "access plus 2 years"
ExpiresByType image/jpe "access plus 2 years"
ExpiresByType image/jpeg "access plus 2 years"
ExpiresByType image/png "access plus 2 years"
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment