Skip to content

Instantly share code, notes, and snippets.

@simbus82
Created Jul 19, 2019
Embed
What would you like to do?
.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