<IfModule mod_headers.c>
# Serve brotli compressed CSS files if they exist
# and the client accepts brotli.
- RewriteCond "%{HTTP:Accept-encoding}" "brotli"
+ RewriteCond "%{HTTP:Accept-encoding}" "br"
RewriteCond "%{REQUEST_FILENAME}\.br" "-s"
RewriteRule "^(.*)\.css" "$1\.css\.br" [QSA]
# Serve brotli compressed JS files if they exist
# and the client accepts brotli.
- RewriteCond "%{HTTP:Accept-encoding}" "brotli"
+ RewriteCond "%{HTTP:Accept-encoding}" "br"
RewriteCond "%{REQUEST_FILENAME}\.br" "-s"
RewriteRule "^(.*)\.js" "$1\.js\.br" [QSA]
- # Serve correct content types, and prevent mod_brotli double brotli.
- RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-brotli:1]
- RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-brotli:1]
+ # 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]
- <FilesMatch "(\.js\.gz|\.css\.gz)$">
+ <FilesMatch "(\.js\.br|\.css\.br)$">
# Serve correct encoding type.
- Header append Content-Encoding brotli
+ Header append Content-Encoding br
# Force proxies to cache brotli &
# non-brotli css/js files separately.