Answer the question
In order to leave comments, you need to log in
How to change the extension from .js to .min.js in .htaccess with checking for file existence?
This is how it works for GZIP:
<FilesMatch "\.js$">
RewriteCond %{HTTP_USER_AGENT} !".*Safari.*"
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule (.*)\.js$ $1\.js.gz [L]
ForceType text/javascript
</FilesMatch>
RewriteCond %{REQUEST_FILENAME}.min.js -f
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question