[wp-trac] [WordPress Trac] #19896: Non-WP rewrites not saved on a multisite install

WordPress Trac noreply at wordpress.org
Thu Dec 17 20:18:35 UTC 2015


#19896: Non-WP rewrites not saved on a multisite install
---------------------------+------------------------------
 Reporter:  johnbillion    |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Rewrite Rules  |     Version:  3.0
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  multisite
---------------------------+------------------------------

Comment (by brs14ku):

 Some clarification here though:

 {{{#!php
 <?php
 add_rewrite_rule(  sanitize_title( $region ) .
 '/([0-9]{4})/([0-9]{1,2})/([^/]+)(?:/([0-9]+))?/?$',
 'index.php?year=$matches[1]&monthnum=$matches[2]&name=$matches[3]&page=$matches[4]'
 , 'top' );

 }}}
 works because the index.php? makes it a wp_rewrite

 Without it, it's considered a non wp rule and would be written to
 .htaccess. However with multisite, that doesn't/can't happen so this
 doesn't even register as a rewrite rule as it is never written to
 .htaccess.

 {{{#!php
 <?php
 add_rewrite_rule(  sanitize_title( $region ) . '/?$', '$matches[1]' ,
 'top' );
 }}}

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


More information about the wp-trac mailing list