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
This commit is contained in:
Ron Rennick 2010-05-19 03:42:55 +00:00
parent 185624ff30
commit fb1ec15763
1 changed files with 7 additions and 2 deletions

View File

@ -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 );
}