WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#5376 closed defect (bug) (wontfix)

rules added via mod_rewrite_rules should be in IfModule section

Reported by: mastermind Owned by: westi
Milestone: Priority: normal
Severity: normal Version: 2.3.1
Component: General Keywords: mod_rewrite mod_rewrite_rules
Focuses: Cc:

Description

When mod_rewrite rules are added via the filter mod_rewrite_rules, the rules should be inserted within the <IfModule mod_rewrite.c></IfModule> tags. At the moment, this is not the case, instead they are appended outside this section.

This shouldn't be a problem on most hosts. Still, it's ugly, and it should be easy to fix by putting the line $rules .= "</IfModule>\n"; just before the return argument in the function mod_rewrite_rules() in wp-includes/rewrite.php (i.e. after the filters are applied).

Change History (3)

comment:1 westi6 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

comment:2 DD325 years ago

By just glancing at this, It seems that in the current state, that filter can be used to filter the entire contents of what will be written to the .htaccess, Moving the filter would remove flexibility to plugins to completely remove the WordPress generated code..

comment:3 Denis-de-Bernardy5 years ago

  • Milestone 2.9 deleted
  • Resolution set to wontfix
  • Status changed from assigned to closed

this would prevent to add mod_alias rules et al if needed.

Note: See TracTickets for help on using tickets.