RewriteRule with L flag - means LAST rule
after rule with L flag no any rules executed.
if you want execute rules in groups then you must each group "separate" by
<IfModule LiteSpeed>
....
</IfModule>
tags
try add GA script to this function
$wgHooks['BeforePageDisplay'][] = 'onBeforePageDisplay';
function onBeforePageDisplay(OutputPage & $out, Skin & $skin) {
$script = '<link href="https://fonts.googleapis.com/css?family=Uncial+Antiqua" rel="preload" as="style">
<link...
if I right understanding, Mediawiki $wgHooks['BeforePageDisplay'] each time redirect output even page in lscache.
lscache send cached page but $wgHooks['BeforePageDisplay'] change header anyway.
I think must by other way add GA script in header.
in my opinion problem in $wgHooks['BeforePageDisplay']
Hooks allow custom code to be executed when some defined event (such as saving a page or a user logging in) occurs.
BeforePageDisplay Allows last minute changes to the output page, e.g. adding of CSS or JavaScript by extensions.
I think...
not sure that function
$wgHooks['BeforePageDisplay'][] = function( OutputPage &$out, Skin &$skin ) {
$code =
in LocalSettings.php is better than Gtag plugin.
in my opinion - Gtag is wrong way for OLS.
LSCache save each page as static html page.
Gtag on each request decide add or not <script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX"></script> to output
LSWS support ESI for header and footer and that's why Gtag can work on...
make clean install of OLS + Mediawiki without any third-party modules or plugins
add LSCache plugin
test.
if work - only than add other plugins and modules.
sometimes order of adding is matter.
check.lscache.io send only gzip encoding request and LSWS "on the fly" recompress br encoding stored page to gzip encoding and provide.
page stored at lscache in br encoding. only LSWS can this.
this site on LiteSpeed server, not OLS (OpenLiteSpeed)
LiteSpeed Web Server (LSWS) server support br encoding for stored lscache (gzip also supported).
OLS support only gzip encoding for lscache.
LSWS can provide stored in br encoding lscache for all encoding requests: br, gzip, deflate...