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

git-svn-id: https://develop.svn.wordpress.org/trunk@6143 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2007-09-20 20:25:43 +00:00
parent 759c182911
commit 2aa1dc4038
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() )