Opened 3 years ago

Closed 3 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: pbearne

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

Download all attachments as: .zip

Change History (15)

Frumph3 years ago

Good web.config

Frumph3 years ago

What happens after clicking save in the settings->permalinks

  • 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

  • Cc pbearne added
  • Severity changed from normal to blocker

this is beaks if you just load the permlinks control pannel

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

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.

comment:6 follow-up: ↓ 8   ruslany3 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\')]');

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

comment:8 in reply to: ↑ 6   Frumph3 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.

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.

Frumph3 years ago

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

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.

  • Keywords has-patch added
  • 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.