$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Subsites in Multisite throw 404 in wp-admin|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Subsites in Multisite throw 404 in wp-admin

matteradmin9PV0评论

I have a multisite (sub directory) network with around 10 sites that has been running for several months in its current environment without any issues. Suddenly (without any code changes) I'm getting 404 errors when trying to access wp-admin for each subsite (the frontend for all sites and wp-admin for the main site works fine).

For example:

  • subsite1/wp-admin - the page loads but all resources are throwing 404s. Getting errors in the console like:

    Refused to apply style from '.../wp-admin/load-styles.php...&ver=4.9.8' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

    load-scripts.php:1 Failed to load resource: the server responded with a status of 404 ()

Then if I try to access a page within wp-admin like: subsite1/wp-admin/anything.php, the page throws a 404.

This is my htaccess file:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
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]

Any ideas at all? Thanks

I have a multisite (sub directory) network with around 10 sites that has been running for several months in its current environment without any issues. Suddenly (without any code changes) I'm getting 404 errors when trying to access wp-admin for each subsite (the frontend for all sites and wp-admin for the main site works fine).

For example:

  • subsite1/wp-admin - the page loads but all resources are throwing 404s. Getting errors in the console like:

    Refused to apply style from '.../wp-admin/load-styles.php...&ver=4.9.8' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

    load-scripts.php:1 Failed to load resource: the server responded with a status of 404 ()

Then if I try to access a page within wp-admin like: subsite1/wp-admin/anything.php, the page throws a 404.

This is my htaccess file:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
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]

Any ideas at all? Thanks

Share Improve this question asked Nov 1, 2018 at 18:09 user2753924user2753924 101
Add a comment  | 

1 Answer 1

Reset to default 0

@user2753924,

I was experiencing a similar(if not the same) issue. I ended up turning PHP-FPM off and that seems to have worked for me.

If you're unsure of how to change this on your hosting account, I'd suggest contacting your host and seeing if they can handle it for you.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far