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

View File

@ -18,6 +18,9 @@ function redirect_canonical($requested_url=NULL, $do_redirect=true) {
if ( false === $original ) if ( false === $original )
return; return;
// Some PHP setups turn requests for / into /index.php in REQUEST_URI
$original['path'] = preg_replace('|/index\.php$|', '/', $original['path']);
$redirect = $original; $redirect = $original;
$redirect_url = false; $redirect_url = false;
@ -111,8 +114,8 @@ function redirect_canonical($requested_url=NULL, $do_redirect=true) {
else else
unset($redirect['port']); unset($redirect['port']);
// trailing /index.php or /index.php/ // trailing /index.php/
$redirect['path'] = preg_replace('|/index.php/?$|', '/', $redirect['path']); $redirect['path'] = preg_replace('|/index.php/$|', '/', $redirect['path']);
// strip /index.php/ when we're not using PATHINFO permalinks // strip /index.php/ when we're not using PATHINFO permalinks
if ( !$wp_rewrite->using_index_permalinks() ) if ( !$wp_rewrite->using_index_permalinks() )