• sagunraj

    (@sagunraj)


    I have a multisite network hosted on Microsoft Azure. I had performed WordPress installation by using the WordPress installation image (not WordPress for Linux) from Azure’s marketplace. Later, I created a multisite network and added a subdomain for setting up the website’s blog. I used the setup instructions given by WordPress to set up the network (including the content of the web.config file). This is the content of the web.config file:

    <?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="^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>
        </system.webServer>
    </configuration>

    After installing the multisite network, the images that I upload to both the main domain and the subdomain do not get loaded on the Media Gallery. Only the grey square boxes are shown. And when I try to open them using the URL found after opening the grey square boxes (for example, https://blog.someurl.com/wp-content/uploads/sites/3/2021/04/img.png or https://someurl.com/wp-content/uploads/sites/3/2021/04/img.png), I get an error message saying:

    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    However, the images uploaded to the main site before setting up the multisite network are working fine. And the newly uploaded images that aren’t loading are also being stored in the storage.

    Could anyone help me out with this issue?

    • This topic was modified 3 years ago by sagunraj.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter sagunraj

    (@sagunraj)

    I was finally able to get this problem solved by changing the upload path of both the sites to the path where the images used to be uploaded before multisite was installed. The installation of multisite had changed the upload path to a path that wasn’t accessible. Hence, I reverted it to the old one. I am not sure if this is a good approach or not.

    mchildress

    (@mchildress)

    I struggled with this a few years ago when we had our multisite installed on Azure. I think we had to add a seventh rule similar to the samples below.

    <system.webServer>
        <rewrite>
          <rules>
            <rule name="Main Rule" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>

    OR

      <system.webServer>
        <rewrite>
          <rules>
            <rule name="WordPress: http://your-azure-site.azurewebsites.net" patternSyntax="Wildcard">
              <match url="*"/>
              <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
              </conditions>
              <action type="Rewrite" url="index.php"/>
            </rule>
          </rules>
        </rewrite>
      </system.webServer>

    Ok so the problem I am getting is images on a subdomain on the new MU install i made do not show up, The images on the main domain are showing.

    Post show up fine on the subdomains.

    here is a link to an article with an broken image.

    my .htaccess looks like this

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    </IfModule>

    https://www.mymilestonecard.run/

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Images not loading on multisite domains’ is closed to new replies.