[wp-trac] [WordPress Trac] #24963: IIS Multisite, Suspected bug in web.config code for URL Rewrite (404 wp-login) (was: IIS Multisite, Suspected bug in web.config code for URL Rewrite)

WordPress Trac noreply at wordpress.org
Wed Mar 15 13:30:04 UTC 2017


#24963: IIS Multisite, Suspected bug in web.config code for URL Rewrite (404 wp-
login)
----------------------------+-----------------------------
 Reporter:  ShaunLeeClarke  |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Future Release
Component:  Rewrite Rules   |     Version:  3.5
 Severity:  normal          |  Resolution:
 Keywords:  needs-testing   |     Focuses:  multisite
----------------------------+-----------------------------

Comment (by danatwp):

 Hi guys,
 I can say "you saved my brain (and my life)".
 I also had the 404 error when trying to access subdir sites dashboards and
 the R:1 to R:2 change in rule #4 solved it !
 I suggest to include "404 wp-login" in the title of this post to help guys
 like me to find this solution.
 Here's my web.config (IIS 7.x and wp 4.7.x):


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

--
Ticket URL: <https://core.trac.wordpress.org/ticket/24963#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list