Skip to content

Instantly share code, notes, and snippets.

@gapple
Created July 16, 2017 06:47
Show Gist options
  • Save gapple/11442062f24c0e4f89e127fa712cbe25 to your computer and use it in GitHub Desktop.
Save gapple/11442062f24c0e4f89e127fa712cbe25 to your computer and use it in GitHub Desktop.
htaccess gzip-bomb
<IfModule mod_rewrite.c>
RewriteEngine On
<IfModule mod_headers.c>
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME} wp-login.php
RewriteRule ^(.*)$ bomb-10G.gzip [QSA]
# Set content type, and prevent mod_deflate double compression.
RewriteRule bomb-[\d]+G\.gzip$ - [T=text/html,E=no-gzip:1]
<FilesMatch "(\.gzip)$">
# Serve correct encoding type.
Header set Content-Encoding gzip
Header append Vary Accept-Encoding
Header unset ETag
FileETag None
# Shared caches 1 month
Header set Cache-Control "public, no-transform, s-maxage=2592000, max-age=0"
</FilesMatch>
</IfModule>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment