No Code Attached Yet
avatar brianteeman
brianteeman
15 May 2024

The Brotli message on Joomla! 4.4.4 and the .htaccess code in htaccess.txt is wrong. It's missing the L flag in the RewriteRule lines. It accidentally works on the core .htaccess only because there are no other RedirectRules after it. If someone adds RedirectRule lines, as is common, the site might break.

joomla-cms/htaccess.txt

Lines 161 to 162 in fcf0ad1

RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1,E=no-brotli:1]
RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1,E=no-brotli:1]

Each of these rules is missing the L flag.

The [L] flag causes mod_rewrite to stop processing the rule set. In most contexts, this means that if the rule matches, no further rules will be processed. Use this flag to indicate that the current rule should be applied immediately without considering further rules.

In the core htaccess file it fortunately does not cause any problems but if you are using your own htaccess file (eg Master Htaccess and follow the advice in the post installation messages and add the lines then this may cause problems.

COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_DESCRIPTION="<p>Before 5.1.0 the default htaccess.txt did not support Brotli compression. This could result in double compression errors when Joomla is installed on a server that uses Brotli compression. You should manually apply the necessary changes to any existing .htaccess file, as this file can not be updated automatically.</p><p>The old code:</p><pre>RewriteRule \"\.css\.gz$\" \"-\" [T=text/css,E=no-gzip:1]<br>RewriteRule \"\.js\.gz$\" \"-\" [T=text/javascript,E=no-gzip:1]</pre><p>The new code:</p><pre>RewriteRule \"\.css\.gz$\" \"-\" [T=text/css,E=no-gzip:1,E=no-brotli:1]<br>RewriteRule \"\.js\.gz$\" \"-\" [T=text/javascript,E=no-gzip:1,E=no-brotli:1]</pre>"

avatar brianteeman brianteeman - open - 15 May 2024
avatar joomla-cms-bot joomla-cms-bot - change - 15 May 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 May 2024
avatar progreccor
progreccor - comment - 20 May 2024

Does that mean you need to make changes to the htaccess file?

Add a Comment

Login with GitHub to post a comment