[wp-trac] [WordPress Trac] #12136: Improve MS rewrite rules

WordPress Trac wp-trac at lists.automattic.com
Thu Mar 11 05:06:28 UTC 2010


#12136: Improve MS rewrite rules
---------------------------------+------------------------------------------
 Reporter:  nacin                |        Owner:  wpmuguru
     Type:  defect (bug)         |       Status:  reopened
 Priority:  normal               |    Milestone:  3.0     
Component:  Rewrite Rules        |      Version:          
 Severity:  normal               |   Resolution:          
 Keywords:  multisite has-patch  |  
---------------------------------+------------------------------------------

Comment(by nacin):

 This has a new patch. Also includes a small optimization from Denis in
 #12497 (closed as a duplicate).

 The issue with wp-content/plugins is that we didn't restrict the initial
 files rewrite to only one directory deep. Thus it matched:
 {{{
 ^blog/files/*
 ^blog/blah/files/*
 ^wp-content/plugins/plugin_name/files/*
 }}}
 And that's why we excluded wp-content/plugins.

 The proper fix would have been to restrict the depth, via
 {{{^([^/]+/)?}}}, which would only have matched the first example above. A
 desire to instead whitelist directories via {{{_0-9a-zA-Z-}}} also
 restricts it to a single directory as it prevents a slash, and thus
 rendering the wp-content/plugins check useless.

 Food for thought: especially since .htaccess is generated dynamically,
 should we strip the directory matching when we're on a subdomain install?
 Seems like it would greatly simplify the rules (unless I'm mistaken, we'd
 end up with just ms-files and the standard WP rules).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12136#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list