[wp-trac] [WordPress Trac] #21372: flush_rewrite_rules() completely overwrites .htaccess

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 25 13:05:28 UTC 2012


#21372: flush_rewrite_rules() completely overwrites .htaccess
---------------------------+-----------------------------
 Reporter:  rulatir        |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Rewrite Rules  |    Version:
 Severity:  major          |   Keywords:
---------------------------+-----------------------------
 A call to flush_rewrite_rules(true) does a very unexpected and potentially
 destructive thing: it completely overwrites .htaccess.

 While this probably isn't stated outright anywhere in the docs, the
 presence of the BEGIN/END delimiters yields a strong impression that it is
 safe to add directives to .htaccess outside the delimited Wordpress
 section.

 If overwriting the whole .htaccess is by design and not a bug, then the
 format of generated .htaccess should be changed. Instead of the BEGIN/END
 comments misleading the developer into thinking that directives outside of
 that section will be preserved, it should contain an EXPLICIT STERN
 WARNING that the file is auto-generated and all changes made to it will be
 lost.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21372>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list