Versions:
- WordPress 3.1.3 with MultiSite enabled
- Windows Server 2008 R2
- IIS 7.5
- URL Rewrite Module 2.0
- MySQL for database
I'm trying to have multiple domains served as different 'sites' with WordPress, but in each domain, it's not at the root, but instead at a path of /blog - it's the same path (/blog) on each domain, though.
The target urls are therefore something like this (there will be around a dozen or so)
Summary: What mechanism(s) are recommended for having this kind of setup? The MultiSite support seems to 'natively' support subdomain (blog1.foo.com, blog2.foo.com) and subfolder (foo.com/blog1, foo.com/blog2), and the MU Domain Mapping supports different domains *if* the blogs are hosted as the site root, but I haven't found a mechanism to support multiple domains when the site is not at the root, but instead at a fixed path of /blog/
Detailed:
In IIS, I have an existing website that handles all the top-level sites (http://www.foo.com/, http://www.bar.net/, http://www.baz.com/) and installed WordPress as an application (right-click, Add -> Application) under that existing site with a path of 'blog'.
After enabling multi-site, the first/existing blog of http://www.foo.com/blog/ is still working fine, but since it wasn't installed at the root of the site, it only allowed me to choose 'subdirectory'. So, at the moment i have the other blogs created, but they're currently at url's like:
- http://www.foo.com/blog/ (the first/existing one)
- http://www.foo.com/blog/bardotnet/
- http://www.foo.com/blog/bazdotcom/
The setting up of the network had me add a set of IIS rewrite rules which allow these other blogs to work fine. One caveat was that one of the rules, targeting ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) (listed as WordPress Rule 5), was incorrectly targeting {R:2} instead of {R:1}, so the resulting request was to content instead of wp-content. Thankfully that was simple to fix, and it might be a change in regex capture-group behavior with the url rewrite module for all I know.
I had initially hoped that that I would be able to use the WordPress MU Domain Mapping plugin (available at http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/), but when trying to do so, trying to access wp-admin for any of the blogs (even the 'main'/first one) to login gives this error:
***********
The domain mapping plugin only works if the site is installed in /. This is a limitation of how virtual servers work and is very difficult to work around.
***********
The error message referencing virtual servers makes me wonder if the difficulty was specifically around Apache virtual servers and perhaps doesn't apply (or has a workaround) for IIS 7.5 + URL Rewrite, but since the error message doesn't give more detail, I won't know without digging into the source or getting lucky and finding a thread discussing it.
Funny enough, thanks to this error, I'm actually in the position of not having a UI for disabling the plugin, but I'm not worried about that at the moment. :)
So, I'm trying to figure out the best approach at this point to get the target url's.
- add some more rewrite rules to try and handle the other url's correctly?
- try modifying the MU Domain Mapping to support non-root paths?
- something else?
Thanks!