Enable gzip module on wampserver server

I want to enable the Gzip module on the Wamp server and open two mods in httpd.conf

LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so

some configurations below

<IfModule mod_deflate.c>
    SetOutputFilter DEFLATE

    SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary 
    SetEnvIfNoCase Request_URI .(?:pdf|mov|avi|mp3|mp4|rm)$ no-gzip dont-vary
</IfModule>

But in the response header I do not see "content-encoding: gzip".

Server: Windows Server 2003 apache: 2.4.4

thanks

+4
source share
2 answers

The code in the .htaccess file in the root directory. Try it, it worked for me

<IfModule mod_deflate.c>
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|html|php|txt|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
+5
source

You may also need to install configs in .htaccess.

<IfModule mod_deflate.c>
  SetOutputFilter DEFLATE
  # Specify file types in case necessary
</IfModule>
0
source

Source: https://habr.com/ru/post/1526679/


All Articles