mikelons
New Member
- Messages
- 16
- Reaction score
- 0
- Points
- 1
Here is the code in my htaccess file that was working to compress all file types using the DEFLATE module. However since the update this no longer works, I have been googling how to get it to work for the past two hours with nothing working. Can you please provide me with a snippet of code that will enable compression? Looking to compress .svg, .html, .js, .css, .woff, .ttf, .otf, .eot. Domain if you need it www.mikelonsdale.co.uk
Code:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript application/json image/svg+xml image/svgz+xml font/woff font/ttf
<FilesMatch "\.(js|css|ttf|otf|eot|woff|font.css|svg|svgz)$" >
SetOutputFilter DEFLATE
</FilesMatch>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48 the above regex won't work. You can use the following workaround to get the desired effect:
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:swf|flv|pdf)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:avi|mov)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:mp3|mp4)$ no-gzip dont-vary
Header append Vary User-Agent
</IfModule>