Wordpress Multisite: Some Images Giving 404 Error After Update To 4.5
<p>I inherited a multisite Wordpress network and am running into a strange issue after updating to Wordpress 4.5. For my domain mapping, I am using the Wordpress MU Domain Mapping plugin.</p>

<p>On a few of my sites, images are not appearing due to a 404 error. I can fix this by changing the primary domain in Tools -> Domain Mapping to the network admin, but this changes the domain of the site I am trying to fix.</p>

<p>In other words, if the main network site is networksite.com and the site I'm trying to fix is subsite.com, I can only fix the images by changing the setting in Domain Mapping to make the domain networksite.com/subsite. This isn't what we want.</p>

<p>When the images work, this is the path to the image displayed on the live page:</p>

<p><a href="http://networksite.com/subsite/wp-content/blogs.dir/13/files/2014/12/image.jpg" rel="nofollow">http://networksite.com/subsite/wp-content/blogs.dir/13/files/2014/12/image.jpg</a></p>

<p>This is odd, because the real path to the image file doesn't contain the subsite name at all.</p>

<p>When I set subsite.com as the primary domain, this is the path that returns a 404:</p>

<p><a href="http://subsite.com/wp-content/blogs.dir/13/files/2014/12/image.jpg" rel="nofollow">http://subsite.com/wp-content/blogs.dir/13/files/2014/12/image.jpg</a></p>

<p>Of note, the preview of the page uses the working image path regardless of the Domain Mapping selection. The permalink is also in networksite.com/subsite format.</p>

<p>Here is my current domain rewrite section of the htaccess file in the public html folder of my site. It comes directly from the Network Setup instructions:</p>

<pre><code>RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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]
</code></pre>

<p>And here is the relevant section of my wp-config.php file:</p>

<pre><code>define('WP_DEBUG', false);
define('WP_ALLOW_MULTISITE', true);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'networksite.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
</code></pre>