I have a strange situation in the multisite media library.

I have a strange situation in the multisite media library. Thumbnails are not shown, and the url of the images is wrong.

The urls are showing /files/year/month/imagename, while the images are in /wp-content/uploads/sites/2/year/month

I checked the .htaccess, and there is a rule RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] which should deal with this.

I checked with my other multisites, and they are doing fine and depicting the correct urls for the images.

The multisite on which this problem appears has had a lot of problems, due to caching. So I cleared all the caches and regenerated the permalinks, nothing worked.

Is there another setting I overlooked somehow? Please let me know. Sophie

  • sophie_fischer

    I already saved the permalinks several times.

    The new images are added to the /files/ directory and the thumbnails are shown. The older images are stored in the /sites/2/ directories and are not shown, because the system is looking for these images in the /files/ directory.

    In my other installations for all images, both upload and view, the directories /sites/2 (or /sites/3, /sites/4 etc) are used.

    Why is that, it seems that the rule
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    in the .htaccess file is ignored. Thanks. Sophie

  • sophie_fischer

    Hello Ari,

    I deactivated and removed all plugins. I reloaded the multi site in a test environment and now I found something ... it is really strange.

    I have done a multi site installation starting with WordPress 3.5.1. This installation should not be using the blogs.dir, as that is removed. And these lines should NOT be in the .htaccess file:

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    But the installation is using the blogs.dir. And when I go to network settings the lines that are proposed for the .htaccess file DO INCLUDE

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    This explains why the images are not found. The /files/ are translated to the /blogs.dir/, where there are no images, since all images are stored under the uploads/sites directories.

    Have you any idea what is happening here? Might this be a setting in one of the tables? I will continue investigating, but if you have an idea, please share it. Sophie

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.