Ticket #5682 (new enhancement)

Opened 10 months ago

Last modified 8 months ago

Clean permalinks and mod_rewrite support for IIS

Reported by: man999 Assigned to: anonymous
Priority: normal Milestone: 2.9
Component: General Version: 2.5
Severity: normal Keywords: has-patch needs-testing
Cc:

Description

Hello team,

In wp-settings.php you have recently introduced a very important improvement that allows Wordpress clean permalinks to work with the two major url rewriting tools, IIS Mod-Rewrite, and ISAPI_Rewrite.

However the condition

if ( empty( $_SERVER['REQUEST_URI'] ) )

in line 29 does not always work properly. PHP 5.2.x always sets the server variable REQUEST_URI, preventing the execution of the supportive code for IIS url rewriting.

My suggestion is to replace this condition with the following one:

if ( empty( $_SERVER['REQUEST_URI'] ) || substr( $_SERVER['SERVER_SOFTWARE'], 0, 13 ) == 'Microsoft-IIS' )

This condition, will accuratelly recognize IIS. I have tested this on IIS versions 5, 6, and 7, and it works perfect on all of them.

Regards

Attachments

5682.r6635.diff (469 bytes) - added by hansengel on 01/18/08 13:58:57.
A patch of man999's solution—test that REQUEST_URI isn't set or that the current server is indeed IIS

Change History

01/18/08 13:52:48 changed by hansengel

  • keywords set to needs-patch.
  • version set to 2.5.
  • milestone changed from 2.6 to 2.5.

01/18/08 13:58:57 changed by hansengel

  • attachment 5682.r6635.diff added.

A patch of man999's solution—test that REQUEST_URI isn't set or that the current server is indeed IIS

01/18/08 13:59:28 changed by hansengel

  • keywords changed from needs-patch to has-patch needs-testing.

03/19/08 23:58:43 changed by ffemtcj

  • milestone changed from 2.5 to 2.6.