Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#11995 closed defect (bug) (duplicate)

2.9.1 rc1 url rewrite rules constantly trying to re-add the rules (iis7)

Reported by: wpmuguru's profile wpmuguru Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Multisite Keywords:
Focuses: Cc:

Description

MU Trac Ticket: http://trac.mu.wordpress.org/ticket/1187

The rewrite rules are consistantly trying to recreate themselves in the web.config file.

bringing the " Cannot add duplicate collection entry of type 'rule' with unique key attribute 'name' set to 'wordpress - strip index.php' "

over and over again

Change History (10)

#1 @wpmuguru
15 years ago

  • Keywords needs-feedback added

Code from the MU ticket:

function iis7_save_url_rewrite_rules(){
	global $wp_rewrite;

	$home_path = get_home_path();
	$web_config_file = $home_path . 'web.config';

	// Using win_is_writable() instead of is_writable() because of a bug in Windows PHP
	if ( ( ! file_exists($web_config_file) && win_is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable($web_config_file) ) {
		if ( iis7_supports_permalinks() ) {
			$rule = $wp_rewrite->iis7_url_rewrite_rules(false, '', '');
			var_dump($rule);
//			if ( ! empty($rule) ) {
//				return iis7_add_rewrite_rule($web_config_file, $rule);
//			} else {
//				return iis7_delete_rewrite_rule($web_config_file);
//			}
		}
	}
	return false;
}

Frumph,
Can you add this before the if and let me know what it dumps out:

var_dump($web_config_file, file_exists($web_config_file));

#2 follow-up: @Frumph
15 years ago

string(32) "C:\inetpub\frumph.net/web.config" bool(true) 

#3 in reply to: ↑ 2 @wpmuguru
15 years ago

Replying to Frumph:

string(32) "C:\inetpub\frumph.net/web.config" bool(true) 

I see now. The if is true based on the win_is_writable() at the end. I'll poke around and see if I can find why the iis7_save_url_rewrite_rules is being called.

#4 follow-up: @wpmuguru
15 years ago

Frumph,

How often does it happen? Just in the admin area, every page view, etc.?

#5 @wpmuguru
15 years ago

  • Milestone changed from Unassigned to 3.0

Adding to the 3.0 list.

#6 @wpmuguru
15 years ago

This looks like it tracks back to the rewrite rules being flushed frequently.

#7 in reply to: ↑ 4 @Frumph
15 years ago

Replying to wpmuguru:

Frumph,

How often does it happen? Just in the admin area, every page view, etc.?

Sorry for not checking back on this. It was every pageview.

#8 @ryan
15 years ago

  • Milestone changed from 3.0 to 3.1

Planning a flush rules rework for 3.1.

#9 @Frumph
15 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

#10 @Frumph
15 years ago

  • Keywords needs-feedback removed
  • Milestone 3.1 deleted
Note: See TracTickets for help on using tickets.