[wp-trac] [WordPress Trac] #19896: Non-WP rewrites not saved on a multisite install
WordPress Trac
wp-trac at lists.automattic.com
Wed Jan 25 16:14:21 UTC 2012
#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 | Keywords:
---------------------------+-----------------------------
The following code adds a rewrite rule which is classed as a non-WP
rewrite rule because its redirect doesn't begin with `index.php`, and is
stored in the `non_wp_rules` member variable of the `WP_Rewrite` class.
{{{
function my_rewrite() {
add_rewrite_rule( 'login/?$', 'wp-login.php', 'top' );
}
add_action( 'init', 'my_rewrite' );
}}}
On a single site install, this rewrite rule gets saved directly to the
.htaccess file rather than being added to WordPress' internal rewrite
array.
On a multisite install, this doesn't happen and the rewrite rule has no
effect (probably because once a site is multisite-d WordPress no longer
writes to .htaccess). The rule has to be manually added to .htaccess.
Likely introduced in 3.0, reproduced in 3.3 and trunk.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19896>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list