Broken Images (and file paths) All of a Sudden
-
Hi all (and Ron!),
I have a long standing Multisite install that has just a few subdomain sites on it and domain mapping has been working without issue for several years until the other day.
On ONE of the subdomain sites, all the images are now broken on the frontend of the site and the file paths appear to be incorrect when viewed in the Media Library. Thumbnails are broken in the Media Library too.
For example an image on the site has this URL:
https://subdomainsite1.mywebsite.com/files/2011/11/theimagefilename.jpg
The actual file exists under this location:
./wp-content/blogs.dir/9/files/2011/11/theimagefilename.jpg
The host and the client claim to not have changed/updated anything including plugins/themes and I have confirmed what I can by looking myself.
I’ve been digging in to try and determine the problem so to start I made a full db backup and then updated WP to 4.2.2 and all plugins that needed updating.
The Domain Mapping plugin also needed updating so I went through that process (very carefully and multiple times) with no fix yet.
I checked the .htaccess file to make sure it had the correct code for a Multisite installation and it appears that it did not. It seems to have had the old .htaccess rules.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
So I then updated the .htaccess file to include the new rules outlined under the “WordPress 3.5+” heading here:
https://codex.www.ads-software.com/Multisite_Network_Administration#.htaccess_and_Mod_RewriteThose rules are below.
RewriteEngine On
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)$ wp/$1 [L]
RewriteRule . index.php [L]However, the images are still broken and now another subdomain site on that install won’t load at all.
If anyone can provide any additional guidance on what else I can try it would be greatly appreciated because at this point I’ve exhausted everything I know to try after searching/reading/implementing changes.
Please help:)
Adam
https://www.ads-software.com/plugins/wordpress-mu-domain-mapping/
- The topic ‘Broken Images (and file paths) All of a Sudden’ is closed to new replies.