Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
enable gzip compression via .htaccess – Useful for WordPress and other sites
<IfModule mod_deflate.c>
# Komprimiere HTML, CSS, JavaScript, Text, XML und fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Browser bugs entfernen (nur für wirklich alte Browser)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>
@mrzpro49

This comment has been minimized.

Copy link

mrzpro49 commented Nov 13, 2018

Hi Phlow, I used the above code in my .htaccess but, for GTMetrix it's as if it were not there...Is there anything I can do?
Thanks

@transcovery

This comment has been minimized.

Copy link

transcovery commented Nov 20, 2018

Hi how are you... I'm not a expert but i'm an autodidact. If you are using some plugin to optimize your site (by example "Autoptimize"), will do not work compress on .htaccess. Because this was compressed for that pluginse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.