Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#12973 closed defect (bug) (fixed)

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

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

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 14 years ago.
Good web.config
web.2.config (3.2 KB) - added by Frumph 14 years ago.
What happens after clicking save in the settings->permalinks
multisitefix.diff (1.3 KB) - added by Frumph 14 years ago.
Change to the misc.php for IIS7 rewrite rules to use start-with

Download all attachments as: .zip

Change History (15)

@Frumph
14 years ago

Good web.config

@Frumph
14 years ago

What happens after clicking save in the settings->permalinks

#1 @ocean90
14 years ago

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

Also #12979

#2 @pbearne
14 years ago

  • Cc pbearne added
  • Severity changed from normal to blocker

#3 @pbearne
14 years ago

this is beaks if you just load the permlinks control pannel

#4 @pbearne
14 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
14 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
14 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
14 years ago

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

#8 in reply to: ↑ 6 @Frumph
14 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
14 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
14 years ago

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

#10 @Frumph
14 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
14 years ago

  • Keywords has-patch added

#12 @westi
14 years ago

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

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

Note: See TracTickets for help on using tickets.