I have a server (w2008 with iis7.5) and domain with a lot of different WP installs.
All of the following represent WP installations.
- x.com/stuff
- x.com/programs/recent
- x.com/programs/asia
- x.com/sandbox/1
- x.com/sandbox/2
- x.com/requests
I have been redirecting x.com to y.com for some time now – with only the WP subsites in use but would like to take off the redirect and start using the root url.
However when I install WP (fresh 3.8.1) in the root (inetpub/wwwroot) it basically breaks every website that I have. I was having various issues, from the site not coming up, to permalinks not working, to not being able to get theme files.
I tried taking out the web.config files on each install and those not coming up came up but of course the permalinks weren’t working.
What are the steps I need to do to get the root working without killing the rest of the WP installs?
On one of the older WP installs that only works with the default permalink and when I set it to default in WP admin it changes the web.config to the follow:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules/>
</rewrite>
</system.webServer>
</configuration>
When I change the same site to year/month/name in the WP admin it sets the web.config to this:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wordpress" 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>
</configuration>
This totally messes up the site (doing this used to work). The site looks like it doesn’t have css or correct paths plus any link needing the rewrite doesn’t work. Also note that I do change the name of the rule so it doesn’t conflict with other wordpress sites. So this one is wordpress_22 – I just copied what WP actually creates.
However on a WP install from last week – on same server just one directory over using year/month/postname I get a web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wordpress" 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>
</configuration>
This site works perfectly fine. I can change the permalinks whatever way and they all work… riddle me that.
In each of the web.config files for each directory, they will look much like this:
For each sub-site, you need to change the rule name and add a clear element. Example:
WordPress will not do this for you because it doesn’t know about any other sites on your system, and IIS configuration is very complicated. As I explained in comments, WordPress’s support for IIS is extremely limited at present. You need to really write these config files yourself if you have any sort of system other than a single site configuration, and for that, you need to find an expert who knows IIS, not necessarily one who knows WordPress in particular.