<pre class="prettyprint lang-config"><IfModule mod_headers.c>
# Serve brotli compressed CSS and JS files if they exist
# and the client accepts brotli.
+ RewriteEngine On
RewriteCond "%{HTTP:Accept-encoding}" "br"
- RewriteCond "%{REQUEST_FILENAME}\.br" "-s"
- RewriteRule "^(.*)\.(js|css)" "$1\.$2\.br" [QSA]
+ RewriteCond "%{LA-U:REQUEST_FILENAME}.br" "-s"
+ RewriteRule "^(.*)\.(js|css)" "$1.$2.br" [QSA]
# Serve correct content types, and prevent double compression.
- RewriteRule "\.css\.br$" "-" [T=text/css,E=no-brotli:1]
- RewriteRule "\.js\.br$" "-" [T=text/javascript,E=no-brotli:1]
-
+ RewriteRule "\.css\.br$" "-" [T=text/css,E=no-brotli:1,E=no-gzip:1]
+ RewriteRule "\.js\.br$" "-" [T=text/javascript,E=no-brotli:1,E=no-gzip:1]
<FilesMatch "(\.js\.br|\.css\.br)$">
# Serve correct encoding type.
<IfModule mod_headers.c>
# Serve brotli compressed CSS and JS files if they exist
# and the client accepts brotli.
+ RewriteEngine On
RewriteCond "%{HTTP:Accept-encoding}" "br"
- RewriteCond "%{REQUEST_FILENAME}\.br" "-s"
- RewriteRule "^(.*)\.(js|css)" "$1\.$2\.br" [QSA]
+ RewriteCond "%{LA-U:REQUEST_FILENAME}.br" "-s"
+ RewriteRule "^(.*)\.(js|css)" "$1.$2.br" [QSA]
# Serve correct content types, and prevent double compression.
- RewriteRule "\.css\.br$" "-" [T=text/css,E=no-brotli:1]
- RewriteRule "\.js\.br$" "-" [T=text/javascript,E=no-brotli:1]
-
+ RewriteRule "\.css\.br$" "-" [T=text/css,E=no-brotli:1,E=no-gzip:1]
+ RewriteRule "\.js\.br$" "-" [T=text/javascript,E=no-brotli:1,E=no-gzip:1]
<FilesMatch "(\.js\.br|\.css\.br)$">
# Serve correct encoding type.