Answer the question
In order to leave comments, you need to log in
Checking for the existence of a gzip file and setting up htaccess?
Tell me how to configure the return of gzip files through .htaccess, if it exists?
Those. do not reap the server, but check for the presence of a gzip file, and if it exists, then give it away (without the .gz extension, but with the title that it is a compressed file), if there is no gzip file, then give the uncompressed version of the file, for example, there is 3 files:
style.css
style.css.gz
style.ie.css
...
<link rel="stylesheet" href="css/style.css"/>
<link rel="stylesheet" href="css/style.ie.css"/>
...
Answer the question
In order to leave comments, you need to log in
You don't need to upload files in .gz format, everything works on the fly.
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include mime ^text\.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image\.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question