lscache_wp
lscache_wp copied to clipboard
.htaccess file updated with incorrect host on multisite
Steps to reproduce
- Setup a domain based multisite on
example.net - Add a new subsite setting
www.example.co.uk - Configure LS Config CSS/JS/Page Cache settings to on.
Expected result
.htaccess file to not mention www.example.co.uk perhaps using references to HTTP_HOST if absolutely needed but avoid referencing hostname if it can. Not be modified regardless of subsites added / settings changed
Actual result
.htaccess file contains many incorrect references to subsite www.example.co.uk
# BEGIN NON_LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
### marker Network CSS/JS Auto Generation Rules start ###
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/https://www.example.co.uk/wp-content
RewriteRule ^([_0-9a-zA-Z-]+/)?(https://www.example.co.uk/wp-content/litespeed/cssjs/.*) $2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/https://www.example.co.uk/wp-content/litespeed/cssjs/.+\.(css|js)$
RewriteRule . /index.php [L]
### marker Network CSS/JS Auto Generation Rules end ###
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END NON_LSCACHE
# BEGIN LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
<IfModule LiteSpeed>
RewriteEngine on
CacheLookup on
RewriteRule .* - [E=Cache-Control:no-autoflush]
RewriteRule \.object-cache\.ini - [F,L]
### marker CACHE RESOURCE start ###
RewriteRule https://www.example.co.uk/wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
### marker CACHE RESOURCE end ###
Notes
The code that seems to be responsible for generating the hostname elements of this is here: https://github.com/litespeedtech/lscache_wp/blob/1033fc0e8b54d5eb0f87e5946f2b5a68599762f6/src/htaccess.cls.php#L643