[wp-testers] web.config

Philip M. Hofer (Frumph) philip at frumph.net
Sun Jan 2 18:40:17 UTC 2011


Detailed? hrm.

WordPress Multisite
Going to settings -> Permalinks,   clicking on a change from a custom 
permalink to the top one (no permalink structure) ?p=  causes the web.config 
rules to be rewritten, inside the web.config the rewrite rule  wordpress -1 
is not being created with the web.config, it's missing, therefor the 
http://domain.tld/files/  references that can pull from the directory that 
is assigned cannot pass through ms-files.php.

Another side effect, any custom rewrite rules that are in the web.config 
that are made by IIS or self are removed upon the rewrite, ignoring the 
name="wordpress - #" portion and just taking everything out and rewriting it 
with whatever wordpress deems is necessary.

This is the web.config I currently have, pre doing anything (backed up):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
  <rule name="wordpress - 1" stopProcessing="true">
   <match url="^(.*/)?files/$"/>
   <action type="Rewrite" url="index.php"/>
  </rule>
  <rule name="Imported Rule 1" stopProcessing="true">
   <match url="^(downloads/.*)" ignoreCase="false" />
   <conditions logicalGrouping="MatchAll" />
  <action type="Rewrite" url="/index.php?sdmon={R:1}" 
appendQueryString="false" />
  </rule>
        <rule name="wordpress - 2" stopProcessing="true">
          <match url="^(.*/)?files/(.*)"/>
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_URI}" pattern=".*wp-content/plugins.*" 
negate="true"/>
          </conditions>
          <action type="Rewrite" url="wp-includes/ms-files.php?file={R:2}" 
appendQueryString="false"/>
        </rule>
        <rule name="wordpress - 3" stopProcessing="true">
          <match url="^(.+)$"/>
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_URI}" pattern="^.*/wp-admin$"/>
          </conditions>
          <action type="Redirect" url="{R:1}/" redirectType="Permanent"/>
        </rule>
        <rule name="wordpress - 4" stopProcessing="true">
          <match url="."/>
          <conditions logicalGrouping="MatchAny">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" pattern=""/>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" 
pattern=""/>
          </conditions>
          <action type="None"/>
        </rule>
        <rule name="wordpress - 5" stopProcessing="true">
          <match url="^([_0-9a-zA-Z-]+/)?(wp-.*)"/>
          <conditions logicalGrouping="MatchAll"/>
          <action type="Rewrite" url="{R:2}"/>
        </rule>
        <rule name="wordpress - 6" stopProcessing="true">
          <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$"/>
          <conditions logicalGrouping="MatchAll"/>
          <action type="Rewrite" url="{R:2}"/>
        </rule>
        <rule name="wordpress - 7" stopProcessing="true">
          <match url="."/>
          <conditions logicalGrouping="MatchAll"/>
          <action type="Rewrite" url="index.php"/>
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>


After hitting settings -> permalinks and setting to the regular ?p= setting 
this is what the web.config looks like:


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="wordpress - 2" stopProcessing="true">
          <match url="^(.*/)?files/(.*)"/>
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_URI}" pattern=".*wp-content/plugins.*" 
negate="true"/>
          </conditions>
          <action type="Rewrite" url="wp-includes/ms-files.php?file={R:2}" 
appendQueryString="false"/>
        </rule>
        <rule name="wordpress - 3" stopProcessing="true">
          <match url="^(.+)$"/>
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_URI}" pattern="^.*/wp-admin$"/>
          </conditions>
          <action type="Redirect" url="{R:1}/" redirectType="Permanent"/>
        </rule>
        <rule name="wordpress - 4" stopProcessing="true">
          <match url="."/>
          <conditions logicalGrouping="MatchAny">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" pattern=""/>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" 
pattern=""/>
          </conditions>
          <action type="None"/>
        </rule>
        <rule name="wordpress - 5" stopProcessing="true">
          <match url="^([_0-9a-zA-Z-]+/)?(wp-.*)"/>
          <conditions logicalGrouping="MatchAll"/>
          <action type="Rewrite" url="{R:2}"/>
        </rule>
        <rule name="wordpress - 6" stopProcessing="true">
          <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$"/>
          <conditions logicalGrouping="MatchAll"/>
          <action type="Rewrite" url="{R:2}"/>
        </rule>
        <rule name="wordpress - 7" stopProcessing="true">
          <match url="."/>
          <conditions logicalGrouping="MatchAll"/>
          <action type="Rewrite" url="index.php"/>
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>


Notice the missing imported rule and the wordpress -1  is missing as well


----- Original Message ----- 
From: "Peter Westwood" <peter.westwood at ftwr.co.uk>
To: <wp-testers at lists.automattic.com>
Sent: Sunday, January 02, 2011 10:18 AM
Subject: Re: [wp-testers] web.config


>
> On 2 Jan 2011, at 17:43, Philip M. Hofer (Frumph) wrote:
>
>> opened a ticket and basically you change permalinks to the default and it 
>> rewrites the web.config, not much to it
>>
>> no idea about what changed between 3.0 and 3.1 haven't had to change 
>> permalinks, it seems to occure when setting it *from* custom to regular 
>> (off) ?p=  style
>>
>
> I can't see a new ticket from you here that relates to web.config:
>
> http://ftwr.me/7h
>
> This one you raise a while back was fixed:
>
> https://core.trac.wordpress.org/ticket/12973
>
> Can you be more detailed in what is broken in 3.1-RC2 ?
>
> Cheers
> -- 
> Peter Westwood
> http://blog.ftwr.co.uk | http://westi.wordpress.com
> C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5
>
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
> 




More information about the wp-testers mailing list