Remove trailing /index.php fixing from canonical.php ... Thanks chaoticmortalcom. fixes #5017

git-svn-id: http://svn.automattic.com/wordpress/trunk@6143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2007-09-20 20:25:43 +00:00
parent 4a03a94051
commit 3be5215e08
1 changed files with 5 additions and 2 deletions

View File

@ -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() )