Problem with multisite virtual domains in IIS

I've run into an interesting problem moving my sites from LAMP to IIS. Although my first set of sites moved perfectly, I'm having some virutal hosting issues.

In particular, I have one MU installation with two domains: and is the main, install domain. I can successfully go to and any WP-managed subdirectory, like

However, when I try to go to any pages on the trackyourcandidate site, like, say trackyourcandidate/governor, IIS tries feeding as the requested URL and looks for it at the physical path of C:\VirtualHosts\wpmu-zdecade\governor\

The graphic attached shows more examples of this, in some detail. Right now, I'm testing this on a test system, using the hosts file to allow me to test all this domain stuff without hurting my production machine.

I'm NOT running any host naming or virtual host plug-in.

Any suggestions would be very appreciated.


The attachment tool doesn't like me, but here's a Dropbox link to the image: Detail Image

  • DavidM
    • DEV MAN’s Mascot

    Hi David,

    I've still not setup anything through IIS as yet so I'm at a bit of a loss there. I'll check with some of the other guys around here, though hopefully some of the IIS users around here will have some insight to share as well!


  • David
    • The Crimson Coder

    Okay, it took a while, but I found what seems to work. There's a file called web.config (basically IIS's equivalent to htaccess) that's necessary to make make this work. WordPress generates a web.config file, but it's wrong. Instead, you should use this, placing the file in the root directory of your multisite WordPress install:

    <?xml version="1.0" encoding="UTF-8"?>
                    <rule name="WordPress Rule 1" stopProcessing="true">
                        <match url="^index\.php$" ignoreCase="false" />
                        <action type="None" />
                    <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 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 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" />
                        <action type="None" />
                    <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 name="WordPress Rule 6" stopProcessing="true">
                        <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
                        <action type="Rewrite" url="{R:2}" />
                    <rule name="WordPress Rule 7" stopProcessing="true">
                        <match url="." ignoreCase="false" />
                        <action type="Rewrite" url="index.php" />

    Credit goes to member naupadarna:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.