Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htaccess redirect rules #43479

Open
brianteeman opened this issue May 15, 2024 · 1 comment
Open

htaccess redirect rules #43479

brianteeman opened this issue May 15, 2024 · 1 comment

Comments

@brianteeman
Copy link
Contributor

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>"

@progreccor
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants