[wp-trac] [WordPress Trac] #25194: Filtered IIS rewrite rules not added to web.config

WordPress Trac noreply at wordpress.org
Tue Jan 28 16:36:17 UTC 2014


#25194: Filtered IIS rewrite rules not added to web.config
-------------------------------------+------------------------------
 Reporter:  pat@…                    |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Rewrite Rules            |     Version:  3.6
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+------------------------------

Comment (by pat@…):

 One thing to note. Adding a rule via $wp_rewrite->add_external_rule() will
 push a rule into an array, which gets added to .htaccess and web.config.
 However, if said rule is commented out, it is not removed from the
 .htaccess file, however, in my patch I am prefixing the rule names with
 'wordpress-non-wp-' which I'm looking for when writing to the web.config.
 If there is a rule present with this prefix that is not in the
 $wp_rewrite->non_wp_rules array then I remove it from the web.config.

 I don't know if this is desirable or not. It's the behavior I would want
 to see as a developer, otherwise your web.config (or .htaccess) could be
 populated by rules from a 3rd party plugin, that when removed, would leave
 orphaned rules that could point the web app in the direction of an error.
 Or, you're developing functionality and want to change the rules, so you
 would need to manually open up the web.config|.htaccess to hunt and peck
 for the rules to remove.

 I like that the rules are added/removed based off the non_wp_rules array,
 however this behavior should be consident with the .htaccess as well.
 Thoughts?

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


More information about the wp-trac mailing list