[wp-trac] [WordPress Trac] #16076: web.config is remade with WPMS when changing permalinks to default issue
WordPress Trac
wp-trac at lists.automattic.com
Sun Jan 2 18:54:26 UTC 2011
#16076: web.config is remade with WPMS when changing permalinks to default issue
--------------------------+-----------------------------
Reporter: Frumph | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.1
Severity: normal | Keywords:
--------------------------+-----------------------------
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
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16076>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list