Skip to content

Instantly share code, notes, and snippets.

@lukecav
Created August 13, 2017 03:22
Show Gist options
  • Save lukecav/4548b1b54fdd26d569a7068c7d2fb6d4 to your computer and use it in GitHub Desktop.
Save lukecav/4548b1b54fdd26d569a7068c7d2fb6d4 to your computer and use it in GitHub Desktop.
Cookie-less image sub-domain in Apache
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>
@lukecav
Copy link
Author

lukecav commented Aug 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment