Index: wp-includes/rewrite.php
===================================================================
--- wp-includes/rewrite.php	(revision 5380)
+++ wp-includes/rewrite.php	(working copy)
@@ -150,84 +150,66 @@
 *******************************************************************************/
 
 class WP_Rewrite {
-	var $permalink_structure;
 	var $use_trailing_slashes;
+	
+	var $author_base;
 	var $category_base;
+	var $comments_base;
+	var $feed_base;
+	var $search_base;
 	var $tag_base;
+	
+	var $author_structure;
 	var $category_structure;
-	var $tag_structure;
-	var $author_base = 'author';
-	var $author_structure;
+	var $comments_feed_structure;
 	var $date_structure;
+	var $feed_structure;
 	var $page_structure;
-	var $search_base = 'search';
+	var $permalink_structure;
 	var $search_structure;
-	var $comments_base = 'comments';
-	var $feed_base = 'feed';
-	var $comments_feed_structure;
-	var $feed_structure;
+	var $tag_structure;
+	
 	var $front;
 	var $root = '';
 	var $index = 'index.php';
 	var $matches = '';
+	
 	var $rules;
 	var $extra_rules; //those not generated by the class, see add_rewrite_rule()
 	var $non_wp_rules; //rules that don't redirect to WP's index.php
+	
 	var $endpoints;
 	var $use_verbose_rules = false;
-	var $rewritecode =
-		array(
-					'%year%',
-					'%monthnum%',
-					'%day%',
-					'%hour%',
-					'%minute%',
-					'%second%',
-					'%postname%',
-					'%post_id%',
-					'%category%',
-					'%tag%',
-					'%author%',
-					'%pagename%',
-					'%search%'
-					);
+	
+	var $rewritecode = array(
+		'%year%', '%monthnum%', '%day%',
+		'%hour%', '%minute%', '%second%',
+		'%postname%', '%post_id%', '%category%',
+		'%tag%', '%author%', '%pagename%',
+		'%search%'
+	);
+	
+	var $rewritereplace = array(
+		'([0-9]{4})', '([0-9]{1,2})', '([0-9]{1,2})',
+		'([0-9]{1,2})', '([0-9]{1,2})', '([0-9]{1,2})',
+		'([^/]+)', '([0-9]+)', '(.+?)',
+		'(.+?)', '([^/]+)', '([^/]+)',
+		'(.+)'
+	);
+	
+	var $queryreplace = array(
+		'year=', 'monthnum=', 'day=',
+		'hour=', 'minute=', 'second=',
+		'name=', 'p=', 'category_name=',
+		'tag=', 'author_name=', 'pagename=',
+		's='
+	);
 
-	var $rewritereplace =
-		array(
-					'([0-9]{4})',
-					'([0-9]{1,2})',
-					'([0-9]{1,2})',
-					'([0-9]{1,2})',
-					'([0-9]{1,2})',
-					'([0-9]{1,2})',
-					'([^/]+)',
-					'([0-9]+)',
-					'(.+?)',
-					'(.+?)',
-					'([^/]+)',
-					'([^/]+)',
-					'(.+)'
-					);
+	var $feeds = array(
+		'feed', 'rdf', 'rss', 
+		'rss2', 'atom'
+	);
 
-	var $queryreplace =
-		array (
-					'year=',
-					'monthnum=',
-					'day=',
-					'hour=',
-					'minute=',
-					'second=',
-					'name=',
-					'p=',
-					'category_name=',
-					'tag=',
-					'author_name=',
-					'pagename=',
-					's='
-					);
-
-	var $feeds = array ( 'feed', 'rdf', 'rss', 'rss2', 'atom' );
-
 	function using_permalinks() {
 		if (empty($this->permalink_structure))
 			return false;
@@ -415,9 +397,15 @@
 			$this->author_structure = '';
 			return false;
 		}
+		
+		if ( empty( $this->author_base ) ) {
+			$this->author_structure = $this->front . 'author/';
+		} else {
+			$this->author_structure = $this->author_base . '/';
+		}
+		
+		$this->author_structure .= '%author%';
 
-		$this->author_structure = $this->front . $this->author_base . '/%author%';
-
 		return $this->author_structure;
 	}
 
@@ -430,9 +418,15 @@
 			$this->search_structure = '';
 			return false;
 		}
+		
+		if ( empty( $this->search_base ) ) {
+			$this->search_structure = $this->root . 'search/';
+		} else {
+			$this->search_structure = $this->search_base . '/';
+		}
+		
+		$this->search_structure .= '%search%';
 
-		$this->search_structure = $this->root . $this->search_base . '/%search%';
-
 		return $this->search_structure;
 	}
 
@@ -460,8 +454,14 @@
 			$this->feed_structure = '';
 			return false;
 		}
+		
+		if ( empty( $this->feed_base ) ) {
+			$this->feed_structure = $this->root . 'feed/';
+		} else {
+			$this->feed_structure = $this->feed_base . '/';
+		}
 
-		$this->feed_structure = $this->root . $this->feed_base . '/%feed%';
+		$this->feed_structure .= '%feed%';
 
 		return $this->feed_structure;
 	}
@@ -475,9 +475,15 @@
 			$this->comment_feed_structure = '';
 			return false;
 		}
+		
+		if ( empty( $this->comments_base ) ) {
+			$this->comment_feed_structure = $this->root . 'comments' . ( !empty( $this->feed_base ) ? $this->feed_base : '/feed' ) . '/';
+		} else {
+			$this->comment_feed_structure = $this->comments_base . ( !empty( $this->feed_base ) ? $this->feed_base : '/feed' ) . '/';
+		}
+		
+		$this->comment_feed_structure .= '%feed%';
 
-		$this->comment_feed_structure = $this->root . $this->comments_base . '/' . $this->feed_base . '/%feed%';
-
 		return $this->comment_feed_structure;
 	}
 
@@ -750,12 +756,11 @@
 		$root_rewrite = apply_filters('root_rewrite_rules', $root_rewrite);
 
 		// Comments
-		$comments_rewrite = $this->generate_rewrite_rules($this->root . $this->comments_base, EP_COMMENTS, true, true, true, false);
+		$comments_rewrite = $this->generate_rewrite_rules($this->get_comment_feed_permastruct(), EP_COMMENTS, true, true, true, false);
 		$comments_rewrite = apply_filters('comments_rewrite_rules', $comments_rewrite);
 
 		// Search
-		$search_structure = $this->get_search_permastruct();
-		$search_rewrite = $this->generate_rewrite_rules($search_structure, EP_SEARCH);
+		$search_rewrite = $this->generate_rewrite_rules($this->get_search_permastruct(), EP_SEARCH);
 		$search_rewrite = apply_filters('search_rewrite_rules', $search_rewrite);
 
 		// Categories
@@ -898,11 +903,18 @@
 		$this->permalink_structure = get_option('permalink_structure');
 		$this->front = substr($this->permalink_structure, 0, strpos($this->permalink_structure, '%'));
 		$this->root = '';
+		
 		if ($this->using_index_permalinks()) {
 			$this->root = $this->index . '/';
 		}
+		
+		$this->author_base = get_option( 'author_base' );
 		$this->category_base = get_option( 'category_base' );
+		$this->comments_base = get_option( 'comments_base' );
+		$this->feed_base = get_option( 'feed_base' );
+		$this->search_base = get_option( 'search_base' );
 		$this->tag_base = get_option( 'tag_base' );
+		
 		unset($this->category_structure);
 		unset($this->author_structure);
 		unset($this->date_structure);
@@ -910,6 +922,7 @@
 		unset($this->search_structure);
 		unset($this->feed_structure);
 		unset($this->comment_feed_structure);
+		
 		$this->use_trailing_slashes = ( substr($this->permalink_structure, -1, 1) == '/' ) ? true : false;
 	}
 
@@ -933,6 +946,34 @@
 			$this->init();
 		}
 	}
+	
+	function set_author_base( $author_base ) {
+		if ( $this->tag_base != $author_base ) {
+			update_option( 'author_base', $author_base );
+			$this->init();
+		}
+	}
+	
+	function set_comments_base( $comments_base ) {
+		if ( $this->comments_base != $comments_base ) {
+			update_option( 'comments_base', $comments_base );
+			$this->init();
+		}
+	}
+	
+	function set_feed_base( $feed_base ) {
+		if ( $this->feed_base != $feed_base ) {
+			update_option( 'feed_base', $feed_base );
+			$this->init();
+		}
+	}
+	
+	function set_search_base( $search_base ) {
+		if ( $this->search_base != $search_base ) {
+			update_option( 'search_base', $search_base );
+			$this->init();
+		}
+	}
 
 	function WP_Rewrite() {
 		$this->init();
Index: wp-admin/wp-admin.css
===================================================================
--- wp-admin/wp-admin.css	(revision 5380)
+++ wp-admin/wp-admin.css	(working copy)
@@ -1339,3 +1339,12 @@
 	margin-right: 220px;
 	text-decoration:underline;
 }
+
+p.permalink-common-option {
+	width: 33%;
+	float: left;
+}
+
+p.permalink-custom {
+	clear: both;
+}
\ No newline at end of file
Index: wp-admin/options-permalink.php
===================================================================
--- wp-admin/options-permalink.php	(revision 5380)
+++ wp-admin/options-permalink.php	(working copy)
@@ -57,33 +57,46 @@
 
 $home_path = get_home_path();
 
-if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) {
+if ( isset( $_POST['submit'] ) ) {
 	check_admin_referer('update-permalink');
-
-	if ( isset($_POST['permalink_structure']) ) {
-		$permalink_structure = $_POST['permalink_structure'];
-		if (! empty($permalink_structure) )
-			$permalink_structure = preg_replace('#/+#', '/', '/' . $_POST['permalink_structure']);
-		$wp_rewrite->set_permalink_structure($permalink_structure);
+	
+	function _clean_base_up( $base ) {
+		return preg_replace( '#/+#', '/', '/' . $base );
 	}
-
-	if ( isset($_POST['category_base']) ) {
-		$category_base = $_POST['category_base'];
-		if (! empty($category_base) )
-			$category_base = preg_replace('#/+#', '/', '/' . $_POST['category_base']);
-		$wp_rewrite->set_category_base($category_base);
+	
+	function _do_rewrite_rules_stuff( $rule_name ) {
+		global $wp_rewrite;
+		
+		if ( isset( $_POST[$rule_name] ) ) {
+			$rule = $_POST[$rule_name];
+			
+			if ( !empty( $rule ) ) {
+				$rule = preg_replace( '#/+#', '/', '/' . $rule );
+			}
+			
+			if ( method_exists( $wp_rewrite, 'set_' . $rule_name ) ) {
+				call_user_func( array( &$wp_rewrite, 'set_' . $rule_name ), $rule );
+			}
+		}
 	}
-
-	if ( isset($_POST['tag_base']) ) {
-		$tag_base = $_POST['tag_base'];
-		if (! empty($tag_base) )
-			$tag_base = preg_replace('#/+#', '/', '/' . $_POST['tag_base']);
-		$wp_rewrite->set_tag_base($tag_base);
+	
+	$possible_rules = array(
+		'permalink_structure', 'author_base', 'category_base', 
+		'comments_base', 'feed_base', 'search_base', 'tag_base'
+	);
+	
+	foreach ( $possible_rules as $rule ) {
+		_do_rewrite_rules_stuff( $rule );
 	}
 }
 
-$permalink_structure = get_option('permalink_structure');
-$category_base = get_option('category_base');
+$permalink_structure = get_option( 'permalink_structure' );
+
+$author_base = get_option( 'author_base' );
+$category_base = get_option( 'category_base' );
+$comments_base = get_option( 'comments_base' );
+$feed_base = get_option( 'feed_base' );
+$search_base = get_option( 'search_base' );
 $tag_base = get_option( 'tag_base' );
 
 if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') )
@@ -112,7 +125,6 @@
   <h2><?php _e('Customize Permalink Structure') ?></h2> 
 <form name="form" action="options-permalink.php" method="post"> 
 <?php wp_nonce_field('update-permalink') ?>
-<p class="submit"><input type="submit" name="submit" value="<?php _e('Update Permalink Structure &raquo;') ?>" /></p>
   <p><?php _e('By default WordPress uses web <abbr title="Universal Resource Locator">URL</abbr>s which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p>
 
 <?php
@@ -153,28 +165,54 @@
 checked="checked"
 <?php } ?>
  />
-<?php _e('Custom, specify below'); ?>
-</label>
-<br />
+<?php _e('Custom:'); ?></label>&nbsp;&nbsp;<input name="permalink_structure" id="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo attribute_escape($permalink_structure); ?>" size="50" />
 </p>
-<p id="customstructure"><?php _e('Custom structure'); ?>: <input name="permalink_structure" id="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo attribute_escape($permalink_structure); ?>" size="50" /></p>
 
+<p class="submit"><input type="submit" name="submit" value="<?php _e('Update Permalink Structure &raquo;') ?>" /></p>
+
 <h3><?php _e('Optional'); ?></h3>
-<?php if ($is_apache) : ?>
-	<p><?php _e('If you like, you may enter a custom prefix for your category <abbr title="Universal Resource Locator">URL</abbr>s here. For example, <code>/taxonomy/tags</code> would make your category links like <code>http://example.org/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p>
-<?php else : ?>
-	<p><?php _e('If you like, you may enter a custom prefix for your category <abbr title="Universal Resource Locator">URL</abbr>s here. For example, <code>/index.php/taxonomy/tags</code> would make your category links like <code>http://example.org/index.php/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p>
-<?php endif; ?>
-	<p> 
-  <?php _e('Category base'); ?>: <input name="category_base" id="category_base" type="text" class="code"  value="<?php echo attribute_escape($category_base); ?>" size="30" /> 
-     </p>
-	  <p>
-	  <?php _e('Tag base'); ?>: <input name="tag_base" id="tag_base" type="text" class="code"  value="<?php echo attribute_escape($tag_base); ?>" size="30" /> 
-     </p> 
-    <p class="submit"> 
-      <input type="submit" name="submit" value="<?php _e('Update Permalink Structure &raquo;') ?>" /> 
-    </p> 
-  </form> 
+
+<table class="permalink-bases" style="width: 99%">
+	<tr>
+		<td style="width: 33%">
+			<h4><?php _e( 'Category Base' ); ?></h4>
+			<p><input type="text" name="category_base" id="category_base" class="code" value="<?php echo attribute_escape( $category_base ); ?>" size="30" /></p>
+			<p><small><?php _e( 'Default:' ); ?> <code>/category</code></small></p>
+		</td>
+		<td style="width: 33%">
+			<h4><?php _e( 'Tag Base' ); ?></h4>
+			<p><input type="text" name="tag_base" id="tag_base" class="code" value="<?php echo attribute_escape( $tag_base ); ?>" size="30" /></p>
+			<p><small><?php _e( 'Default:' ); ?> <code>/tag</code></small></p>
+		</td>
+		<td>
+			<h4><?php _e( 'Author Base' ); ?></h4>
+			<p><input type="text" name="author_base" id="author_base" class="code" value="<?php echo attribute_escape( $author_base ); ?>" size="30" /></p>
+			<p><small><?php _e( 'Default:' ); ?> <code>/author</code></small></p>
+		</td>
+	</tr>
+	<tr>
+		<td>
+			<h4><?php _e( 'Search Base' ); ?></h4>
+			<p><input type="text" name="search_base" id="search_base" class="code" value="<?php echo attribute_escape( $search_base ); ?>" size="30" /></p>
+			<p><small><?php _e( 'Default:' ); ?> <code>/search</code></small></p>
+		</td>
+		<td>
+			<h4><?php _e( 'Feed Base' ); ?></h4>
+			<p><input type="text" name="feed_base" id="feed_base" class="code" value="<?php echo attribute_escape( $feed_base ); ?>" size="30" /></p>
+			<p><small><?php _e( 'Default:' ); ?> <code>/feed</code></small></p>
+		</td>
+		<td>
+			<h4><?php _e( 'Comments Feed Base' ); ?></h4>
+			<p><input type="text" name="comments_base" id="comments_base" class="code" value="<?php echo attribute_escape( $comments_base ); ?>" size="30" /></p>
+			<p><small><?php _e( 'Default:' ); ?> <code>/comments</code></small></p>
+		</td>
+	</tr>
+</table>
+
+<p class="submit"><input type="submit" name="submit" value="<?php _e('Update Permalink Structure &raquo;') ?>" /></p>
+
+</form>
+
 <?php if ( $permalink_structure && !$usingpi && !$writable ) : ?>
   <p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Make_a_Directory_Writable">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>
 <form action="options-permalink.php" method="post">
Index: wp-admin/upgrade-schema.php
===================================================================
--- wp-admin/upgrade-schema.php	(revision 5380)
+++ wp-admin/upgrade-schema.php	(working copy)
@@ -243,8 +243,12 @@
 	add_option('default_link_category', 2);
 	add_option('show_on_front', 'posts');
 
-	// 2.2
+	// 2.3
 	add_option('tag_base');
+	add_option( 'author_base' );
+	add_option( 'search_base' );
+	add_option( 'comments_base' );
+	add_option( 'feed_base' );
 
 	// Delete unused options
 	$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing');
