WordPress.org

Ready to get started?Download WordPress

Forums

Multisite Multidomain images not working after update (10 posts)

  1. JCBauza
    Member
    Posted 1 year ago #

    Hi,

    My sites used to work but now none of the pictures display across the different domains. I already read a few posts so I´ve checked that the files exist on the server, the file permissions, and because it is hosted on Windows the web.config for the re-write rules according to the installation instructions (just fix them a bit as I think there were some parse errors, I´m including the information below). I have no clue why the images stopped working but any help would be greatly appreciated it. One of the sites URL is: http://tienda.transformacionpuebla.com/

    Below is the Web.config file I have and after it the one WP suggested which I think it has some issues:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
    		<directoryBrowse enabled="false" />
            <rewrite>
                <rules>
                    <rule name="WordPress Rule 1" stopProcessing="true">
                        <match url="^index\.php$" ignoreCase="false" />
                        <action type="None" />
                    </rule>
                    <rule name="WordPress Rule for Files" stopProcessing="true">
                        <match url="^files/(.+)" ignoreCase="false" />
                        <action type="Rewrite" url="wp-includes/ms-files.php?file={R:1}" appendQueryString="false" />
                    </rule>
                    <rule name="WordPress Rule 2" stopProcessing="true">
                        <match url="^wp-admin$" ignoreCase="false" />
                        <action type="Redirect" url="wp-admin/" redirectType="Permanent" />
                    </rule>
                    <rule name="WordPress Rule 3" 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 4" stopProcessing="true">
                        <match url="^(wp-(content|admin|includes).*)" ignoreCase="false" />
                        <action type="Rewrite" url="/{R:1}" />
                    </rule>
                    <rule name="WordPress Rule 5" stopProcessing="true">
                        <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
                        <action type="Rewrite" url="/{R:2}" />
                    </rule>
                    <rule name="WordPress Rule 6" stopProcessing="true">
                        <match url="." ignoreCase="false" />
                        <action type="Rewrite" url="index.php" />
                    </rule>
                </rules>
            </rewrite>
    		<defaultDocument>
                <files>
                    <clear />
                    <add value="index.html" />
                    <add value="index.htm" />
                    <add value="default.html" />
                    <add value="default.htm" />
                    <add value="index.php" />
                    <add value="default.php" />
                    <add value="index.pl" />
                    <add value="default.pl" />
                    <add value="default.asp" />
                    <add value="default.aspx" />
                    <add value="index.asp" />
                    <add value="index.aspx" />
                    <add value="holding.html" />
                </files>
            </defaultDocument>
            <httpErrors errorMode="Detailed" />
        </system.webServer>
    </configuration>

    and below is what WP suggests but it seems the code used to generate it had some issues:

    <?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>';
    				if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {
    					 .= '
                    <rule name="WordPress Rule for Files" stopProcessing="true">
                        <match url="^files/(.+)" ignoreCase="false" />
                        <action type="Rewrite" url="C:\transformacionpuebla.com\wwwroot/wp-includes/ms-files.php?file={R:1}" appendQueryString="false" />
                    </rule>';
                    }
                     .= '
                    <rule name="WordPress Rule 2" stopProcessing="true">
                        <match url="^wp-admin$" ignoreCase="false" />
                        <action type="Redirect" url="wp-admin/" redirectType="Permanent" />
                    </rule>
                    <rule name="WordPress Rule 3" 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 4" stopProcessing="true">
                        <match url="^(wp-(content|admin|includes).*)" ignoreCase="false" />
                        <action type="Rewrite" url="C:\transformacionpuebla.com\wwwroot/{R:1}" />
                    </rule>
                    <rule name="WordPress Rule 5" stopProcessing="true">
                        <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
                        <action type="Rewrite" url="C:\transformacionpuebla.com\wwwroot/{R:2}" />
                    </rule>
                    <rule name="WordPress Rule 6" stopProcessing="true">
                        <match url="." ignoreCase="false" />
                        <action type="Rewrite" url="index.php" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
  2. Try the 3.5.1 beta version: http://make.wordpress.org/core/2013/01/05/call-for-testers-for-3-5-1/

    There were some weird Windows issues.

  3. JCBauza
    Member
    Posted 1 year ago #

    Still not working after that but now instead of a not found error I get a weird handler error. Also, on the root site the images work fine but not on the subdomains and the URL paths look different. For example:

    Root site *working*

    http://transformacionpuebla.com/wp-content/uploads/2012/08/Transformacion-Puebla-SA-de-CV-Metallurgy-Real-Estate-Consulting-Technology-Logo-No-Border.png

    Sub site *Not working*
    http://computo.transformacionpuebla.com/files/2012/08/excel-2010-logo-225x150.png

    Based on the error it seems it is trying to find the file on wwwroot\files\20128\excel-2010-logo-225x150.png when it should be on wwwroot\wp-content\blogs.dir\2\files\20128\excel-2010-logo-225x150.png

    Any ideas?

    EDIT:
    I used the default web.config settings provided but the rules had the URL to be rewritten as C:\Something and previously it didn't have the physical path of the installation. I removed that to match the old style and now I don't get the error on screen but the pictures still do not display. Maybe MSFiles is the culprit?

  4. Okay, that's not actually an error.

    http://computo.transformacionpuebla.com/files/2012/08/excel-2010-logo-225x150.png

    That's the correct URL to show. That gets parsed through ms-files via this rule:

    if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {
    					 .= '
                    <rule name="WordPress Rule for Files" stopProcessing="true">
                        <match url="^files/(.+)" ignoreCase="false" />
                        <action type="Rewrite" url="C:\transformacionpuebla.com\wwwroot/wp-includes/ms-files.php?file={R:1}" appendQueryString="false" />
                    </rule>';
                    }

    So don't worry about the URLs being different. The problem is that rule isn't getting called. And I don't know enough about IIS to know why :/ I know on apache it measn your httpd.conf doesn't have AllowOverride set to All (or Options All).

  5. JCBauza
    Member
    Posted 1 year ago #

    I have two sites on the same box using multisite and one works fine and the other doesn't... the only difference is that one is using the multiple domain mapping plugin. Is there a way to debug it or manually trying a URL like http://computo.transformacionpuebla.com/wp-includes/ms-files.php?file=2012/08/excel-2010-logo-225x150.png ?
    When I try http://photo.bauzas.com/wp-includes/ms-files.php?file=2012/07/IMG_0094.jpg it works fine so I think ms-files should be getting called, maybe the multidomain plugin is breaking something?

  6. Unlikely given how many people use that plugin.

    http://photo.bauzas.com/files/2012/07/IMG_0094.jpg works.

    http://computo.transformacionpuebla.com/files/2012/08/excel-2010-logo-225x150.png isn't even giving you a WordPress error. This is your server.

  7. JCBauza
    Member
    Posted 1 year ago #

    Well, what's weird is that the root site does display images correctly while the subsites don't and another installation on the same server does work. I think I'm just going to do a fresh installation and import/export posts and see if that works although it is going to be a pain.

    working image on root site: http://transformacionpuebla.com/wp-content/uploads/2012/08/Transformacion-Puebla-SA-de-CV-Metallurgy-Real-Estate-Consulting-Technology-Logo-No-Border.png

  8. JCBauza
    Member
    Posted 1 year ago #

    I just reinstalled and created the first site and it is not working while the root site is. I have also placed the wordpress files on my web host and then on a private web server and the results are consistent. I am going to try playing with the rewrite rules next.

  9. JCBauza
    Member
    Posted 1 year ago #

    I guess the rules were wrong, the pictures do show up now but they are stored on Sites rather than blogs.dir on the new install. I give up, lol. I am going to disable the rewrite rule that uses msfiles and copy for each blog the files to a /files folder and then do the import/export that way... That is the fastest way I can think of to move to a fresh install that Works. Probably something got messed up when I did the update.

  10. If you start with WP 3.5, the images are in sites :) Just to screw with your head, sorry :)

Topic Closed

This topic has been closed to new replies.

About this Topic