Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#10386 closed enhancement (fixed)

The rewrite rules generated for IIS URL Rewrite Module causes user confusion

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


This is related to #8974. If the IIS web.config file does not exist, the rewrite rules XML that is given at the "Permalinks Settings" page contains only the rewrite rule, but not all the parent XML configuration tags required by IIS. Very often users just take this XML and paste it into an empty web.config file and this causes the IIS configuration runtime error (HTTP 500 returned).

The logic should be to check if the web.config file does not exist and if the root directory is not writable then provide the complete web.config file content, which users can just copy and paste into the empty web.config file. See attached screenshot for how it is supposed to look like.

Attachments (3)

CreateWebConfig.png (149.0 KB) - added by ruslany 5 years ago.
If the web.config file does not exist then the instructions and the XML given to the users should be different.
10386.patch (4.6 KB) - added by ruslany 5 years ago.
Patch with proposed fix.
10386-whale.patch (5.9 KB) - added by peaceablewhale 5 years ago.

Download all attachments as: .zip

Change History (11)

ruslany5 years ago

If the web.config file does not exist then the instructions and the XML given to the users should be different.

ruslany5 years ago

Patch with proposed fix.

peaceablewhale5 years ago

comment:1 peaceablewhale5 years ago

I have uploaded a patch that improves the formatting of the web.config file generated by WordPress and fixes an encoding conflict by forcing the generated file to be UTF-8.

comment:2 peaceablewhale5 years ago

  • Component changed from General to Administration

The patch has to be updated when #10384 is fixed.

comment:3 ruslany5 years ago

Verified the new patch (10386-whale.patch). Works well. Thanks for fixing up the formatting and encoding issue.

comment:4 ryan4 years ago

  • Component changed from Administration to Rewrite Rules

comment:5 westi4 years ago

  • Keywords needs-testing added
  • Priority changed from normal to high

Could someone check the patch still applies and works as expected please so we can get this into 2.9

comment:6 ruslany4 years ago

  • Keywords needs-testing removed

I have just tried the patch with the latest version (WordPress 2.9-beta-1) and it applied and worked as expected.

comment:7 peaceablewhale4 years ago

Verified working too

comment:8 ryan4 years ago

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

(In [12264]) Improve IIS rewrite support. Props ruslany, peaceablewhale. fixes #10386

Note: See TracTickets for help on using tickets.