• Hello!

    Having an extremely irritating problem that I hope someone can help me with… I have tried searching the forum, and tried several tips with out effect.

    I have just moved our WP multisite (subfolder) from a Windows 2008 Server running IIS7 to a Windows 2012 R2 running IIS 8. On the old server, all images and documents worked fine. The domain is the same.

    I am running WP 4, but the multisite was created on in an earlier version of WP.

    I moved the site by just copying the entire setup to the new server. The web.config used is the same. Folder settings are correct.

    On the new server permalinks work fine, documents load fine and images on the main site works fine.

    However – images on all subsites are broken. Not visible in the editor, on the page or in the media manager.

    At first I thought the problem might be with the web.config – most users with similar problems seems to have problems with that. But I couldn’t get that working. And my feeling is that the same web.config I used on the old server should work here.

    What mostly made me thin that web.config is not the problem, however, is the fact that I am able to load pdf:s that are uploaded in the media manager. The page-links to pdf-documents work fine, and they are stored in the same file structure as the images.

    Upload of new images does not work either – images are uploaded to the file structure, but they are broken when they appear in the media manager.

    I sort of gave up and tried creating a new site – exporting the old site and importing it to the new. But that proved to be to challenging – I don’t have time for all the manual updates it would take.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter HenkeWil

    (@henkewil)

    If you know of a thread that has the solution to this problem, please link to that thread.

    I have tried searching several threads with similar issues, with not luck.

    Thread Starter HenkeWil

    (@henkewil)

    One thing that makes me think that web.config actually could be what is messing things up is this:

    This type of link does not work:

    /subsitename/files/2014/11/elise_sysselsattningen_liten.jpg

    ..however this link does work:

    /wp-content/blogs.dir/21/files/2014/11/elise_sysselsattningen_liten.jpg

    …this would indicate that there is nothing wrong with the images themselves, but still WordPress produces the first kind of link.

    The really odd part though is that this works fine:
    /subsitename/files/2014/11/Infobrev-Kattarp.pdf

    If there was a problem with web.config – wouldn’t both of the links that includes the subsitename be broken?

    My web.config:

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name=”WordPress Rule 1″ stopProcessing=”true”>
    <match url=”^index\.php$” ignoreCase=”false” />
    <action type=”None” />
    </rule>
    <rule name=”WordPress Rule 2″ stopProcessing=”true”>
    <match url=”^([_0-9a-zA-Z-]+/)?files/(.+)” ignoreCase=”false” />
    <action type=”Rewrite” url=”wp-includes/ms-files.php?file={R:2}” appendQueryString=”false” />
    </rule>
    <rule name=”WordPress Rule 3″ stopProcessing=”true”>
    <match url=”^([_0-9a-zA-Z-]+/)?wp-admin$” ignoreCase=”false” />
    <action type=”Redirect” url=”{R:1}wp-admin/” redirectType=”Permanent” />
    </rule>
    <rule name=”WordPress Rule 4″ stopProcessing=”true”>
    <match url=”^” ignoreCase=”false” />
    <conditions logicalGrouping=”MatchAny”>
    <add input=”{REQUEST_FILENAME}” matchType=”IsFile” ignoreCase=”false” />
    <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” ignoreCase=”false” />
    </conditions>
    <action type=”None” />
    </rule>
    <rule name=”WordPress Rule 5″ stopProcessing=”true”>
    <match url=”^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)” ignoreCase=”false” />
    <action type=”Rewrite” url=”{R:2}” />
    </rule>
    <rule name=”WordPress Rule 6″ stopProcessing=”true”>
    <match url=”^([_0-9a-zA-Z-]+/)?(.*\.php)$” ignoreCase=”false” />
    <action type=”Rewrite” url=”{R:2}” />
    </rule>
    <rule name=”WordPress Rule 7″ stopProcessing=”true”>
    <match url=”.” ignoreCase=”false” />
    <action type=”Rewrite” url=”index.php” />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

    Thread Starter HenkeWil

    (@henkewil)

    Link to one of the subsites with broken images: https://blogg.helsingborg.se/dengemensammastaden/

    I am able to update the database for any subsite with the direct url to the image on the server – which would solve the problem with showing existing images. However, this is no solution, since I am still unable to add new images if I do it this way.

    Thread Starter HenkeWil

    (@henkewil)

    I tried changing rule 2 in my web.config after checking this thread:

    https://wordpress.stackexchange.com/questions/73783/broken-image-multisite

    It worked – although it is not an ideal solution. But whatever works… My new rule looks like this:

    <rule name=”WordPress Rule 2″ stopProcessing=”true”>
    <match url=”^([_0-9a-zA-Z-]+/)?files/(.+)” ignoreCase=”false” />
    <action type=”Rewrite” url=”wp-content/blogs.dir/21/files/{R:2}” appendQueryString=”false” />
    </rule>

    This works fine for the subsite with site id=21! However, I don’t have a clue to get it working for all subsites. I tried simply adding more <action>-tags with the rest of the site id’s. But I sort of knew it wouldn’t work ??

    Does anyone know how to make a rule that…eh…rules them all…all of the site id’s? Would be ideal not having to edit the web.config anytime I add a new site also – but I can live with that if there is no other way.

    Still find it strange my old web.config won’t work on the new server though.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Images broken in multisite after movie to new server. Documents work.’ is closed to new replies.