[wpmu-trac] [WordPress MU Trac] #540: Tighten 'files/' RewriteRule

WordPress MU Trac wpmu-trac at lists.automattic.com
Wed Jan 9 16:42:57 GMT 2008


#540: Tighten 'files/' RewriteRule
------------------------+---------------------------------------------------
 Reporter:  jdub        |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:          
Component:  component1  |     Version:          
 Severity:  normal      |    Keywords:          
------------------------+---------------------------------------------------
 If a plugin includes a 'files/' directory, the current 'files/'
 RewriteRule is loose enough to munge those URLs, leading to lots of 404s
 and unexpected behaviour.

 Fixing this, at least in WPMU's htaccess.dist, is desireable because
 plugin authors might use a 'files/' directory, and it would thoroughly
 discombobulate users if files from a plugin appeared to 404 for no good
 reason.

 The fix is relatively simple. We just tighten the RewriteRule match like
 so (see 3rd line):

 {{{
 #uploaded files
 RewriteRule ^(.*/)?files/$ index.php [L]
 RewriteRule ^(.*/)?files/([0-9]{4}/[0-9]{2}/.*) wp-
 content/blogs.php?file=$2 [L]
 }}}

-- 
Ticket URL: <http://trac.mu.wordpress.org/ticket/540>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser


More information about the wpmu-trac mailing list