A question on Wordpress Multisite running on Windows Azure using Sub-directories: does it work? how do you do it?.
I've installed Wordpress(4.2.2) from the Azure Gallery, updated the wp.config.php and web.config files to enable and install Multisites, but the result is a half working solution: Multi-sites is installed, and I can create and delete new sites, but the new sites have no css styling (404 errors) and I can't access their admin dashboards (404: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable).
So, for example, the base website:
http://mywordpressmultisite.azurewebsites.net
works fine. But the multi-sites:
http://mywordpressmultisite.azurewebsites.net/site2/ http://mywordpressmultisite.azurewebsites.net/site3/
Display an unstyled css website, but I can't really do anything with them since I have no admin access; a routing error perhaps.
More Details
I've followed this how to article: https://azure.microsoft.com/en-gb/documentation/articles/web-sites-php-convert-wordpress-multisite/, to set-up Wordpress Multisite on Azure for sub-directories. I haven't followed on past the section entitled Add Custom Domains because I don't want to do that (yet, anyway).
My web.config file is:
<?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-]+/)?wp-admin$" ignoreCase="false" />
<action type="Redirect" url="{R:1}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="^([_0-9a-zA-Z-]+/)?(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-]+/)?([_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>
My wp-config.php is:
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'mywordpressmultisite.azurewebsites.net');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
Things I've tried
- Using both the Free and Shared hosting solutions.
- Checking permalinks work on standard wordpress and the base No1 site (so mywordpressmultisite.azurewebsites.net/helloworld works).
- Scrubbing down the database and starting the whole process again.
- Changing file permissions to allow read, write and execute; just in case.
Debugging
I've configured the WebApp on Windows Azure to log everything possible but it's not spitting anything out. There's nothing in the php_error.log or other log files that I can find. I've configured wordpress wp-config.php as follows, but again nothing is being produced that I can find:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', true);
@ini_set('display_errors', 0);
Where I am I'm flat out of ideas on how to get this work, and I'm beginning to wonder whether it actually does work on Azure for sub-directories? I have seen other references to this issue on the web but no solutions.