[wp-trac] [WordPress Trac] #5682: Clean permalinks and mod_rewrite support for IIS

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 17 12:40:03 GMT 2008


#5682: Clean permalinks and mod_rewrite support for IIS
-------------------------+--------------------------------------------------
 Reporter:  man999       |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  2.6      
Component:  General      |     Version:           
 Severity:  normal       |    Keywords:           
-------------------------+--------------------------------------------------
 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

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5682>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list