#11995 closed defect (bug) (duplicate)
2.9.1 rc1 url rewrite rules constantly trying to re-add the rules (iis7)
| Reported by: | wpmuguru | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Multisite | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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)
#3
in reply to: ↑ 2
@
16 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:
↓ 7
@
16 years ago
Frumph,
How often does it happen? Just in the admin area, every page view, etc.?
#7
in reply to: ↑ 4
@
16 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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: