Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#12973 closed defect (bug) (fixed)

Multisite and IIS7 - permalinks change, the web.config problem

Reported by: Frumph Owned by: ryan
Priority: high Milestone: 3.0
Component: Rewrite Rules Version: 3.0
Severity: blocker Keywords: has-patch
Cc: Focuses:

Description

When adjusting the settings->permalinks with IIS7/server 2008 what is happening is the wp code is 'adding' to the web.config's current rules and not deleting the old. So the duplicate rule key error is coming up.

Attachments (3)

web.config​ (1.8 KB ) - added by Frumph 17 years ago.
Good web.config
web.2.config​ (3.2 KB ) - added by Frumph 17 years ago.
What happens after clicking save in the settings->permalinks
multisitefix.diff​ (1.3 KB ) - added by Frumph 17 years ago.
Change to the misc.php for IIS7 rewrite rules to use start-with

Download all attachments as: .zip

Change History (15)

@Frumph
17 years ago

Good web.config

@Frumph
17 years ago

What happens after clicking save in the settings->permalinks

#1 @ocean90
17 years ago

  • Component General → Rewrite Rules
  • Milestone Unassigned → 3.0
  • Owner set to ryan
  • Priority normal → high

Also #12979

#2 @pbearne
17 years ago

  • Cc pbearne added
  • Severity normal → blocker

#3 @pbearne
17 years ago

this is beaks if you just load the permlinks control pannel

#4 @pbearne
17 years ago

there is add on problem to this

the .htaccess allows extra rules to be add (generated) to IIS code is a just a dump of a stactic text block

So plugins like supper cache can't add the rules it needs to work

It would good if we fixed this if not for 3.0 but in the next version

Paul

#5 @Frumph
17 years ago

This is a blocker for me, because it crashs after changing the permalink structure so then editing the web.config to fix it manually - it never gets to the point of actually changing the permalink structure in the database.

#6 follow-up: @ruslany
17 years ago

The patch for this bug ​http://trac.mu.wordpress.org/ticket/991 used to take care of this problem. It was checked in to WPMU last year. But it looks like the latest version of WPMU reverted back to the old code and because of that this problem happens. The line in question is in /wp-admin/include/misc.php

$rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[@name=\'wordpress\']');

It should be $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');

#7 @pbearne
17 years ago

I thought I had seen it before and Ben had fixed it

#8 in reply to: ↑ 6 @Frumph
17 years ago

Replying to ruslany:

The patch for this bug ​http://trac.mu.wordpress.org/ticket/991 used to take care of this problem. It was checked in to WPMU last year. But it looks like the latest version of WPMU reverted back to the old code and because of that this problem happens. The line in question is in /wp-admin/include/misc.php

$rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[@name=\'wordpress\']');

It should be $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');

This does not fix the issue. It appears that it's not checking if the rules pre-exist.

If I delete the web.config before hitting the permalinks -save it saves again.

Unfortunately I need it to check if the rules pre-exist since i have some custom rules.

#9 @Frumph
17 years ago

Sorry my bad, if I delete the web.config completely it does the same thing with a freshly made web.config from the system.

Like the rules are trying to be added twice someplace, going to try to trace it.

@Frumph
17 years ago

Change to the misc.php for IIS7 rewrite rules to use start-with

#10 @Frumph
17 years ago

Earliar I didn't change all of the locations required to use the starts-with, the above diff is the ones that required the change, it's now working on my IIS7 properly.

#11 @nacin
17 years ago

  • Keywords has-patch added

#12 @westi
17 years ago

  • Resolution → fixed
  • Status new → closed

(In [14312]) Fix support for rewrites on IIS7. Fixes #12973 props Frumph and ruslany.

Note: See TracTickets for help on using tickets.