Image display problem on sub sites: is this fix OK?
-
Hi, I’ve been faced by what appears to be the common problem of images not displaying in my sub-sites. I’ve come up with a rewrite fix which works but as I’ve not seen this solution anywhere else (and it seems quite simple) I’m worried it may have unforeseen consequences!!
Basically images are uploading to /wp-content/blogs.dir/** but for a reason I don’t understand WP makes the file URL: https://sub.domain/files – a folder that doesn’t exist!
So I’ve just forced a wildcard rewrite (see below) in htaccess from /files/ to wp-content/blogs.dir.
It appears to work well but I’m worried that WP must have separate destinations for upload path and file url for a reason so my question is:
1. Is the fix likely to cause problems?
2. Why does WP point to a non-existent folder (/files) in the first place?In case it helps my situation in detail is:
Fresh install of 3.0
Network of sites enabled and working well (subdomains)
Images not displaying on subsites but fine on main blogImages upload OK and can be found in /wp-content/blogs.dir/****
but in web browsers the image URL is /files/*** and as this folder doesn’t even exist the images don’t display.The problem occurs on both admin & public sides so its not a theme issue.
In Network Admin > Sites > Edit > Settings I tried changing the settings of Upload Path (wp-content/blogs.dir/2/files) and Fileupload URL (http;//sub.domain/files) – to make the upload url the same as the upload path but this had no effect.
I searched all the many forum posts but none seemed to give me the answer as my rewrite appears to be set up well and working fine.
So eventually and I decided just to force the rewrite from /files to wp-content/blogs.dir using this code
RewriteRule ^files\/?(.*)$ "http\:\/\/\(www\.\)\?\*\*\ All\ Public\ Domains\ \*\*\/wp\-content\/blogs\.dir$1" [R=301,L]
Thanks a lot for any guidance!!
- The topic ‘Image display problem on sub sites: is this fix OK?’ is closed to new replies.