From fb1ec15763fc0ce9a8a28436a30d6db1b0ed8446 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Wed, 19 May 2010 03:42:55 +0000 Subject: [PATCH] don't use both /blog & /index.php on main site permalinks, see #13106 git-svn-id: https://develop.svn.wordpress.org/trunk@14733 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/options-permalink.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index e22a2bb6e2..df263dcd9f 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -86,8 +86,13 @@ if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { if ( isset( $_POST['permalink_structure'] ) ) { $permalink_structure = $_POST['permalink_structure']; - if ( ! empty( $permalink_structure ) ) - $permalink_structure = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $permalink_structure ) ); + if ( ! empty( $permalink_structure ) ) { + $permalink_structure = preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $permalink_structure ) ); + if ( $prefix && $blog_prefix ) + $permalink_structure = $prefix . preg_replace( '#^/?index\.php#', '', $permalink_structure ); + else + $permalink_structure = $blog_prefix . $permalink_structure; + } $wp_rewrite->set_permalink_structure( $permalink_structure ); }