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