WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#13679 closed defect (bug) (fixed)

The URL rewrite rules generated by WordPress for IIS 7 are malformed and cause server errors

Reported by: ruslany Owned by: westi
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Rewrite Rules Keywords: has-patch patch-tested
Focuses: Cc:

Description

When configuring pretty permalinks on IIS 7 and the iis config file web.config does not exist then WordPress auto-generates the following xml configuration:

configuration>
			 	<system.webServer>
			 		<rewrite>
			 			<rules>
			
				 <configuration>
				 	<system.webServer>
				 		<rewrite>
				 			<rules>
				
			 <rule name="wordpress" patternSyntax="Wildcard">
			 	<match url="*" />
			 		<conditions>
			 			<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
			 			<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
			 		</conditions>
			 	<action type="Rewrite" url="index.php" />
			 </rule>
			
			 			</rules>
			 		</rewrite>
			 	</system.webServer>
			 </configuration>
			

This is a malformed XML and when user puts it into the web.config file it results in IIS generating server error HTTP 500.

Also, the XML indentation is broken.

This seems to be a regression as it worked fine in WordPress 2.9.X.

Attachments (3)

13679.diff (652 bytes) - added by duck_ 12 years ago.
13679.2.diff (6.7 KB) - added by duck_ 12 years ago.
with some indenting
13679.3.diff (6.8 KB) - added by ruslany 12 years ago.
Indentation fixes

Download all attachments as: .zip

Change History (6)

@duck_
12 years ago

#1 @duck_
12 years ago

  • Keywords has-patch needs-testing added; regression removed

Seems to me that rules were accidentally not removed from !is_multisite conditional in r14871. The indenting seems to be like that after cleaning up the code :( r14885

13679.diff should hopefully help with the malformed XML, but does nothing about indenting.

X-ref #12758

@duck_
12 years ago

with some indenting

@ruslany
12 years ago

Indentation fixes

#2 @ruslany
12 years ago

  • Keywords patch-tested added; needs-testing removed

The patch provided by duck_ fixes the problem. I've modified it slightly to remove emptly lines in the xml.

#3 @ryan
12 years ago

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

(In [15109]) IIS rewrite fixes. Props duck_, ruslany. fixes #13679

Note: See TracTickets for help on using tickets.