WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Azure WP Network Install : 404 Server Error on Subdomains (2 posts)

  1. nant
    Member
    Posted 1 year ago #

    Hello. I am trying to set up a network (MU) install of WordPress as an Azure Website. I have completed the following steps. The main site works fine but all subdomain sites give me a 404 Serer error.

    To be specific, I have completed the following steps:

    • Created Azure WordPress website using the gallery. This installed v3.4.
    • Configured it in Shared mode and configured the domains with an A record for wp.mydomain.net.
    • Add a *.wp DNS A record. nslookup for <any>.wp.mydomain.net yields the IP address of Azure Website. So, it feels like this is ok.
    • Created network install per http://codex.wordpress.org/Create_A_Network

    Key lines from my wp-config.php are as follows:
    /** Multisite */
    define('WP_ALLOW_MULTISITE', true);

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'wp.saiuniti.net');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    Web.config are as follows:
    <?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="^files/(.+)" ignoreCase="false" />
    <action type="Rewrite" url="wp-includes/ms-files.php?file={R:1}" appendQueryString="false" />
    </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="." ignoreCase="false" />
    <action type="Rewrite" url="index.php" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

    I have also created the blog.dir. These were the only instructions in the Network Setup page. It appears .htaccess is not required for this version/Azure.

    I am able to navigate the main site (wp.mydomain.net). I also created a test.wp.mydomain.net site. Whenever I got to that site, however, I get a Server Error 404 File or Directory not found. I get the same error if I type <random_word>.wp.mydomain.net.

    I am at a loss of how to debug this further. Any help is greatly appreciated.

  2. nant
    Member
    Posted 1 year ago #

    Never mind! I just figured it out. Turns out that with Azure, creating a wildcard A record is not sufficient. The request gets to Azure but it never passes it on the website. The 404 appears to be coming from Azure.

    As soon as I added the hosts explicitly to the domain manager, the subdomains work!

    I need to figure out how I can do this without having to add each site to the domain manager.

Topic Closed

This topic has been closed to new replies.

About this Topic