0

I cloned an inherited WP Multisite and have got it up and running thanks to advice in a this and this previous questions. Things are moving along with the exception of images.

Missing Images

On one of the sub-blogs, images inside content posts aren't showing up. For example I have <img title="CNDP Pic" src="http://192.168.33.10/study/files/2012/06/C123-Pic.png" alt="Pic" width="150" height="108">. However, the browser cannot find this file.

enter image description here

Found in the file system

However, I do see this file on the file system. vagrant@vagrant-ubuntu-trusty-64:/var/www$ find | grep C123-Pic.png ./wp-content/blogs.dir/18/files/2012/06/C123-Pic.png

Database looks okay enter image description here

htaccess

RewriteEngine On
RewriteBase /
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]

How to remap? Is there an area in the database where I can correct this mapping /study/files/2012/06/ = /wp-content/blogs.dir/18/files/2012/06/)?

1
  • 1
    Just run a full find and replace on this database. This is a good tool. Commented Nov 18, 2014 at 21:04

1 Answer 1

2

Turns out .htaccess was missing the following lines

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
3
  • Still... why would you want to rewrite this for EVERY REQUEST when you also could do a database replacement?
    – edelwater
    Commented Nov 18, 2014 at 21:17
  • Well this is an inherited project. I need to create a dev space to test updates and get this back to where it needs to be. I will consider this however! Thank you
    – Rick
    Commented Nov 18, 2014 at 21:19
  • 3
    Besides if the multisite setup was started before WP 3.5 the rule is supposed to be there. @edelwater Commented Nov 18, 2014 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.