[wp-testers] web.config

John O'Nolan john.wp at onolan.org
Sun Jan 2 21:32:40 UTC 2011


It was a friendly suggestion intended constructively, sarcasm not  
required.




On 2 Jan 2011, at 21:30, Philip M. Hofer (Frumph) wrote:

> Yeah you're right, this is obviously the wrong place wp-testers@ to  
> test things that seemingly are a bug.  Taking it to trac.
>
>
>
>
> ----- Original Message ----- From: "John O'Nolan" <john.wp at onolan.org>
> To: <wp-testers at lists.automattic.com>
> Sent: Sunday, January 02, 2011 1:25 PM
> Subject: Re: [wp-testers] web.config
>
>
>> Might be worth moving this convo to IRC or Trac
>>
>> John
>>
>>
>>
>>
>> On 2 Jan 2011, at 21:21, Philip M. Hofer (Frumph) wrote:
>>
>>> basically in iis7_save_url_rewrite_rules, it loads the one you're  
>>> rreferences into $rule, which is then returned via  
>>> iis7_add_rewrite_rule($web_config_file, $rule);
>>>
>>> so the iis7_add_rewrite_rule() is taking the hard written one and  
>>> parsing it as individual dom/xml items
>>>
>>> Sooo, yeah, you're right, i'm right, thats why I said "well to a   
>>> degree" it's not exactly reading and writing as a single line,  
>>> it's  taking the elements and turning them into items then adding  
>>> them,  then writing
>>>
>>> which is why i'm thinking the ->item(0); reference in that block  
>>> is causing a 'misstep'
>>>
>>>
>>> ----- Original Message ----- From: "Paul Bearne" <pbearne at gmail.com>
>>> To: <wp-testers at lists.automattic.com>
>>> Sent: Sunday, January 02, 2011 12:19 PM
>>> Subject: Re: [wp-testers] web.config
>>>
>>>
>>>> OK then waht is
>>>>
>>>> http://phpxref.ftwr.co.uk/wordpress/wp-includes/rewrite.php.html#iis7_url_rewrite_rules
>>>>
>>>> doing
>>>>
>>>> It looks like we make 2 bits of code
>>>> <http://phpxref.ftwr.co.uk/wordpress/wp-includes/rewrite.php.html#iis7_url_rewrite_rules
>>>> >
>>>> Paul Bearne
>>>> http://www.bearne.com
>>>>
>>>>
>>>> On Sun, Jan 2, 2011 at 2:57 PM, Philip M. Hofer (Frumph)
>>>> <philip at frumph.net>wrote:
>>>>
>>>>> Actually they're not, well to a degree, take a look at
>>>>> wp-admin/includes/misc.php  to the iis7_add_rewrite_rule()  
>>>>> function
>>>>>
>>>>> This is what is created to create the web.config innards (not  
>>>>> hardcoded)
>>>>>
>>>>> So what i'm thinking is that the xmlnodes length isn't handling  
>>>>> it proper
>>>>> so the first -> item(0) is bypassed
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ----- Original Message ----- From: "Paul Bearne" <pbearne at gmail.com 
>>>>> >
>>>>>
>>>>> To: <wp-testers at lists.automattic.com>
>>>>> Sent: Sunday, January 02, 2011 11:45 AM
>>>>>
>>>>> Subject: Re: [wp-testers] web.config
>>>>>
>>>>>
>>>>> The rewrite rules for WP-MS is hardcoded and fixed in WPMU 2.8  
>>>>> and ported
>>>>>> into wp3.0
>>>>>> is something else have ago at updated the rules wp rights them  
>>>>>> as  a single
>>>>>> text string
>>>>>>
>>>>>> Paul Bearne
>>>>>> http://www.bearne.com
>>>>>>
>>>>>>
>>>>>> On Sun, Jan 2, 2011 at 1:40 PM, Philip M. Hofer (Frumph)
>>>>>> <philip at frumph.net>wrote:
>>>>>>
>>>>>> 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
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> wp-testers mailing list
>>>>>>> wp-testers at lists.automattic.com
>>>>>>> http://lists.automattic.com/mailman/listinfo/wp-testers
>>>>>>>
>>>>>>> _______________________________________________
>>>>>> wp-testers mailing list
>>>>>> wp-testers at lists.automattic.com
>>>>>> http://lists.automattic.com/mailman/listinfo/wp-testers
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> wp-testers mailing list
>>>>> wp-testers at lists.automattic.com
>>>>> http://lists.automattic.com/mailman/listinfo/wp-testers
>>>>>
>>>> _______________________________________________
>>>> wp-testers mailing list
>>>> wp-testers at lists.automattic.com
>>>> http://lists.automattic.com/mailman/listinfo/wp-testers
>>>
>>>
>>> _______________________________________________
>>> wp-testers mailing list
>>> wp-testers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-testers
>>
>> _______________________________________________
>> wp-testers mailing list
>> wp-testers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-testers
>
>
> _______________________________________________
> 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