Permalink
Browse files

Remove trailing /index.php fixing from canonical.php ... Thanks chaot…

…icmortalcom. fixes #5017

git-svn-id: http://svn.automattic.com/wordpress/trunk@6143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 4a03a94 commit 3be5215e08e12fb3ae67e0a1f4643c929a5a56b6 markjaquith committed Sep 20, 2007
Showing with 5 additions and 2 deletions.
  1. +5 −2 wp-includes/canonical.php
@@ -18,6 +18,9 @@ function redirect_canonical($requested_url=NULL, $do_redirect=true) {
if ( false === $original )
return;
+ // Some PHP setups turn requests for / into /index.php in REQUEST_URI
+ $original['path'] = preg_replace('|/index\.php$|', '/', $original['path']);
+
$redirect = $original;
$redirect_url = false;
@@ -111,8 +114,8 @@ function redirect_canonical($requested_url=NULL, $do_redirect=true) {
else
unset($redirect['port']);
- // trailing /index.php or /index.php/
- $redirect['path'] = preg_replace('|/index.php/?$|', '/', $redirect['path']);
+ // trailing /index.php/
+ $redirect['path'] = preg_replace('|/index.php/$|', '/', $redirect['path']);
// strip /index.php/ when we're not using PATHINFO permalinks
if ( !$wp_rewrite->using_index_permalinks() )

0 comments on commit 3be5215

Please sign in to comment.