I’ve two wp sites (multisite) with the following config:
1#
(Main site) Home: http:// www.mysite.com
Upload Path: wp-content/uploads
Fileupload Url: http:// www.mysite.com/wp-content/uploads
2#
Home: http:// www.mysite.com/en/
Upload Path: wp-content/blogs.dir/2/files
Fileupload Url: http:// www.mysite.com/en/files
My .htaccess has the following:
# BEGIN WordPress
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).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress
The first site is working 100%, i can upload images, view them on the media library & post edit and they show OK in the page
The second site, when I upload the image, it shows a broken image: http://i.stack.imgur.com/EsMg4.gif
But when I click the “edit image” button it shows OK: http://i.stack.imgur.com/5gMIH.gif
I’ve checked and the image is on the right folder (http: //www.mysite.com/blogs.dir/2/files/honey.jpg) but it’s broken in the admin panel and the site. The url of the broken image is: http: //www.mysite.com/en/files/honey.jpg
I’ve lost hours trying to fix it through .htaccess and changing the wordpress config but nothing seems to work. Any ideas?
Thanks!
After reading several topics about this issue I’ve found this:
However, this didn’t work, i had to replace (or comment) the uploaded files line and change the new one to work in all sites. In the end this is the .htaccess that worked OK:
Being ‘N’ the number of my non-primary site
So, I guess that for each site, you have to add another line changing the number.
Hope this helps.