I have a WP multisite setup which has the some plugins installed. Im having some issues inside the admin panels of the subsites.
For the Network and the main sub-site (i.e. /, the root URL), it works as expected. But on any non-root URL sub-site (i.e. /subsite1, /subsite2), the plugins are currently breaking because it’s trying to load the CSS & JS assets under that sub-site path. It causes the plugins to break entirely for any of the non-root subsites (i.e. infinite loading in the post/page editor, settings will not load).
Currently assets are loading like this:
https://example.com/site/SUBSITE/wp-content/plugins/advanced-custom-fields/assets/build/css/acf-global.css
But Should be loading like this:
https://example.com/site/wp-content/plugins/advanced-custom-fields/assets/build/css/acf-global.css
I’ve done some research but it seems this problem varies for everyone and the solutions i’ve found have not worked.
My wp-config has this
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
define( 'DOMAIN_CURRENT_SITE', 'mydomain' );
define( 'PATH_CURRENT_SITE', '/site/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
And my .htacces have this
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /site/
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
Im at my wits end, Im posting in multiple forums to see if I can get some ideas to fix this
]]>(The URL given is a sample page on one of the subsites residing in a directory.)
The images are uploaded to https://ssnet.org/wp-content/blogs.dir/12/files, and they show up fine with the direct URL to location.
The problem is that the blog attempts to access images at https://sabbathissues.org/files/ and I even tried to specify https://sabbathissues.org/uploads in in the multi-site settings, but neither of the URLs work even though they are specified in the upload_url_path settings. Deleting the line doesn’t work either – even after flushing both Litespeed and browser caches.
I use the Litespeed plugin on a Linux an Apache server (Apache is disabled in favor of Litespeed.)
My .htaccess file looks like this:
DIRECT ALL TRAFFIC TO SECURE SITE
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
END REDIRECTION TO SECURE SITE
BEGIN LSCACHE
LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block!
RewriteEngine on
CacheLookup on
RewriteRule .* - [E=Cache-Control:no-autoflush]
RewriteRule .litespeed_conf.dat - [F,L]
marker CACHE RESOURCE start
RewriteRule wp-content/./[^/](responsive|css|js|dynamic|loader|fonts).php - [E=cache-control:max-age=3600]
marker CACHE RESOURCE end
marker FAVICON start
RewriteRule favicon.ico$ - [E=cache-control:max-age=86400]
marker FAVICON end
marker DROPQS start
CacheKeyModify -qs:fbclid
CacheKeyModify -qs:gclid
CacheKeyModify -qs:utm*
CacheKeyModify -qs:_ga
marker DROPQS end
LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block!
END LSCACHE
BEGIN NON_LSCACHE
LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block!
marker BROWSER CACHE start
ExpiresActive on
ExpiresByType application/pdf A2592000
ExpiresByType image/x-icon A2592000
ExpiresByType image/vnd.microsoft.icon A2592000
ExpiresByType image/svg+xml A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/png A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/webp A2592000
ExpiresByType video/ogg A2592000
ExpiresByType audio/ogg A2592000
ExpiresByType video/mp4 A2592000
ExpiresByType video/webm A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType application/javascript A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/x-font-ttf A2592000
ExpiresByType application/x-font-woff A2592000
ExpiresByType application/font-woff A2592000
ExpiresByType application/font-woff2 A2592000
ExpiresByType application/vnd.ms-fontobject A2592000
ExpiresByType font/ttf A2592000
ExpiresByType font/otf A2592000
ExpiresByType font/woff A2592000
ExpiresByType font/woff2 A2592000
marker BROWSER CACHE end
LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block!
END NON_LSCACHE
BEGIN WordPress Multisite
RewriteEngine On
RewriteBase /
RewriteRule ^(.*/)?files/$ index.php [L]
add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(..php)$ $2 [L]
RewriteRule . index.php [L]
END WordPress#
Google Analytics Integration - Added by cPanel.
AddOutputFilterByType SUBSTITUTE text/html Substitute "s|()?||i"
END Google Analytics Integration
Wordfence WAF
php_value auto_prepend_file '/home/ssnet/public_html/wordfence-waf.php'
php_value auto_prepend_file '/home/ssnet/public_html/wordfence-waf.php'
Require all denied Order deny,allow Deny from all
END Wordfence WAF
BEGIN LiteSpeed
SetEnv noabort 1
END LiteSpeed
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https://bewellandprosper.net/.$ [NC] RewriteCond %{HTTP_REFERER} !^https://bewellandprosper.net$ [NC] RewriteCond %{HTTP_REFERER} !^https://sabbathissues.org/.$ [NC]
RewriteCond %{HTTP_REFERER} !^https://sabbathissues.org$ [NC]
RewriteCond %{HTTP_REFERER} !^https://ssnet.org/.$ [NC] RewriteCond %{HTTP_REFERER} !^https://ssnet.org$ [NC] RewriteCond %{HTTP_REFERER} !^https://www.bewellandprosper.net/.$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.bewellandprosper.net$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.sabbathissues.org/.$ [NC] RewriteCond %{HTTP_REFERER} !^https://www.sabbathissues.org$ [NC] RewriteCond %{HTTP_REFERER} !^https://www.ssnet.org/.$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.ssnet.org$ [NC]
RewriteCond %{HTTP_REFERER} !^https://bewellandprosper.net/.$ [NC] RewriteCond %{HTTP_REFERER} !^https://bewellandprosper.net$ [NC] RewriteCond %{HTTP_REFERER} !^https://sabbathissues.org/.$ [NC]
RewriteCond %{HTTP_REFERER} !^https://sabbathissues.org$ [NC]
RewriteCond %{HTTP_REFERER} !^https://ssnet.org/.$ [NC] RewriteCond %{HTTP_REFERER} !^https://ssnet.org$ [NC] RewriteCond %{HTTP_REFERER} !^https://www.bewellandprosper.net/.$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.bewellandprosper.net$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.sabbathissues.org/.$ [NC] RewriteCond %{HTTP_REFERER} !^https://www.sabbathissues.org$ [NC] RewriteCond %{HTTP_REFERER} !^https://www.ssnet.org/.$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.ssnet.org$ [NC]
Rewrite rule causes jpg requests to fail
RewriteRule .*.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
SOFTACULOUS Block .htaccess and .htpasswd
SOFTACULOUS Block .htaccess and .htpasswd End
php -- BEGIN cPanel-generated handler, do not edit
Set the “ea-php74” package as the default “PHP” programming language.
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
php -- END cPanel-generated handler, do not edit
protect wpconfig.php
order allow,deny deny from all
There is no ms-settings file in my “wp-includes” directory.
]]>I’ve discovered this is because we are using the Multisites Enhancements plugin with the following option selected:
– Add status labels for no-index and external domain to blogs in “my Sites” menu
If I turn off this option the menu goes back to normal, however, we can no longer see which sites are set to a no-index status which we use between staging environments to identify on production that the option is turned off. No other plugin has affected this menu before and we are using a fair amount of plugins in our multisite network. This is the first time we’ve had an issue with the menu displaying incorrectly.
Any help is appreciated.
Thanks!
]]>Experiencing a problem with a redirect loop when accessing WP Admin.
But it’s only affecting subsites, not the root site or network admin.
Plus, the redirect only affects the /wp-admin/ folder. Going directly to /wp-admin/index.php (and all other files in the folder) work fine.
The network is setup with subsites using their own domains, via domain name mapping.
HTACCESS has the following:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress
I’ve checked the permissions on the wp-admin folder and they appear to be set correctly. There are no additional htaccess files in the wp-admin folder either.
Any ideas?
]]>TIA,
]]>Thanks in advance!
]]>It looks ok, but when I log in as admin to a subsite, it tells me I’ll have to do 9 more updates in the Admin menu at the top.
If I click on the update link, I’m sent back to site 1 (normal) but everything is up to date.
An idea ? Thanks for your lights.
]]>