Index: bb-templates/kakumei/tags.php
===================================================================
--- bb-templates/kakumei/tags.php	(revision 912)
+++ bb-templates/kakumei/tags.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Tags'); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Tags'); ?></h3>
 
 <p><?php _e('This is a collection of tags that are currently popular on the forums.'); ?></p>
 
Index: bb-templates/kakumei/favorites.php
===================================================================
--- bb-templates/kakumei/favorites.php	(revision 912)
+++ bb-templates/kakumei/favorites.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Favorites'); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Favorites'); ?></h3>
 
 <h2 id="currentfavorites"><?php _e('Current Favorites'); ?><?php if ( $topics ) echo ' (' . $favorites_total . ')'; ?></h2>
 
Index: bb-templates/kakumei/search.php
===================================================================
--- bb-templates/kakumei/search.php	(revision 912)
+++ bb-templates/kakumei/search.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Search')?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Search')?></h3>
 <?php bb_topic_search_form(); ?>
 
 <?php if ( !empty ( $q ) ) : ?>
@@ -35,5 +35,5 @@
 <p><?php _e('No results found.') ?></p>
 <?php endif; ?>
 <br />
-<p><?php printf(__('You may also try your <a href="http://google.com/search?q=site:%1$s %2$s">search at Google</a>'), bb_get_option('uri'), urlencode($q)) ?></p>
+<p><?php printf(__('You may also try your <a href="http://google.com/search?q=site:%1$s %2$s">search at Google</a>'), bb_get_uri(), urlencode($q)) ?></p>
 <?php bb_get_footer(); ?>
Index: bb-templates/kakumei/login.php
===================================================================
--- bb-templates/kakumei/login.php	(revision 912)
+++ bb-templates/kakumei/login.php	(working copy)
@@ -1,11 +1,11 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Log in'); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Log in'); ?></h3>
 
 <h2><?php isset($_POST['user_login']) ? _e('Log in Failed') : _e('Log in') ; ?></h2>
 
 
-<form method="post" action="<?php bb_option('uri'); ?>bb-login.php">
+<form method="post" action="<?php bb_uri('bb-login.php', 'action'); ?>">
 <table width="50%">
 <?php if ( $user_exists ) : ?>
 	<tr valign="top">
@@ -21,7 +21,7 @@
 	<tr valign="top" class="error">
 		<th scope="row"><?php _e('Username:'); ?></th>
 		<td><input name="user_login" type="text" value="<?php echo $user_login; ?>" /><br />
-		<?php _e('This username does not exist.'); ?> <a href="<?php bb_option('uri'); ?>register.php?user=<?php echo $user_login; ?>"><?php _e('Register it?'); ?></a></td>
+		<?php _e('This username does not exist.'); ?> <a href="<?php bb_uri('register.php'); ?>?user=<?php echo $user_login; ?>"><?php _e('Register it?'); ?></a></td>
 	</tr>
 	<tr valign="top">
 		<th scope="row"><?php _e('Password:'); ?></th>
@@ -47,7 +47,7 @@
 
 <?php if ( $user_exists ) : ?>
 <hr />
-<form method="post" action="<?php bb_option('uri'); ?>bb-reset-password.php">
+<form method="post" action="<?php bb_uri('bb-reset-password.php', 'action'); ?>">
 <p><?php _e('If you would like to recover the password for this account, you may use the following button to start the recovery process:'); ?><br />
 <input name="user_login" type="hidden" value="<?php echo $user_login; ?>" />
 <input type="submit" value="<?php echo attribute_escape( __('Recover Password &raquo;') ); ?>" /></p>
Index: bb-templates/kakumei/login-form.php
===================================================================
--- bb-templates/kakumei/login-form.php	(revision 912)
+++ bb-templates/kakumei/login-form.php	(working copy)
@@ -1,5 +1,5 @@
-<form class="login" method="post" action="<?php bb_option('uri'); ?>bb-login.php">
-<p><?php printf(__('<a href="%1$s">Register</a> or log in'), bb_get_option('uri').'register.php') ?>:</p>
+<form class="login" method="post" action="<?php bb_uri('bb-login.php', 'action'); ?>">
+<p><?php printf(__('<a href="%1$s">Register</a> or log in'), bb_get_uri('register.php')) ?>:</p>
 <p>
 	<label><?php _e('Username:'); ?><br />
 		<input name="user_login" type="text" id="user_login" size="13" maxlength="40" value="<?php echo attribute_escape( $_COOKIE[ bb_get_option( 'usercookie' ) ] ); ?>" />
Index: bb-templates/kakumei/view.php
===================================================================
--- bb-templates/kakumei/view.php	(revision 912)
+++ bb-templates/kakumei/view.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php view_name(); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php view_name(); ?></h3>
 
 <?php if ( $topics || $stickies ) : ?>
 
Index: bb-templates/kakumei/topic.php
===================================================================
--- bb-templates/kakumei/topic.php	(revision 912)
+++ bb-templates/kakumei/topic.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <a href="<?php forum_link(); ?>"><?php forum_name(); ?></a></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <a href="<?php forum_link(); ?>"><?php forum_name(); ?></a></h3>
 <div class="infobox">
 
 <div id="topic-info">
Index: bb-templates/kakumei/password-reset.php
===================================================================
--- bb-templates/kakumei/password-reset.php	(revision 912)
+++ bb-templates/kakumei/password-reset.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Log in'); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Log in'); ?></h3>
 
 <h2><?php _e('Password Reset'); ?></h2>
 
Index: bb-templates/kakumei/profile-edit.php
===================================================================
--- bb-templates/kakumei/profile-edit.php	(revision 912)
+++ bb-templates/kakumei/profile-edit.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Edit Profile'); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Edit Profile'); ?></h3>
 <h2 id="userlogin"><?php echo get_user_name( $user->ID ); ?></h2>
 <form method="post" action="<?php profile_tab_link($user->ID, 'edit');  ?>">
 <fieldset>
Index: bb-templates/kakumei/header.php
===================================================================
--- bb-templates/kakumei/header.php	(revision 912)
+++ bb-templates/kakumei/header.php	(working copy)
@@ -15,7 +15,7 @@
 		var page = <?php global $page; echo $page; ?>;
 		var currentUserId = <?php bb_current_user_info( 'id' ); ?>;
 		var topicId = <?php topic_id(); ?>;
-		var uriBase = '<?php bb_option('uri'); ?>';
+		var uriBase = '<?php bb_uri(null, 'script'); ?>';
 		var tagLinkBase = '<?php bb_tag_link_base(); ?>';
 		var favoritesLink = '<?php favorites_link(); ?>'; 
 		var isFav = <?php if ( false === $is_fav = is_user_favorite( bb_get_current_user_info( 'id' ) ) ) echo "'no'"; else echo $is_fav; ?>;
@@ -31,7 +31,7 @@
 	<div id="wrapper">
 	
 		<div id="header">
-			<h1><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a></h1>
+			<h1><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a></h1>
 			<?php login_form(); ?>
 
 		</div>
Index: bb-templates/kakumei/forum.php
===================================================================
--- bb-templates/kakumei/forum.php	(revision 912)
+++ bb-templates/kakumei/forum.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php forum_name(); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php forum_name(); ?></h3>
 
 <?php if ( $topics || $stickies ) : ?>
 
Index: bb-templates/kakumei/rss2.php
===================================================================
--- bb-templates/kakumei/rss2.php	(revision 912)
+++ bb-templates/kakumei/rss2.php	(working copy)
@@ -9,7 +9,7 @@
 
 <channel>
 <title><?php echo $title; ?></title>
-<link><?php bb_option('uri'); ?></link>
+<link><?php bb_uri(); ?></link>
 <description><?php echo $title; ?></description>
 <language>en</language>
 <pubDate><?php echo gmdate('D, d M Y H:i:s +0000'); ?></pubDate>
@@ -20,7 +20,7 @@
 <link><?php post_link(); ?></link>
 <pubDate><?php bb_post_time('D, d M Y H:i:s +0000'); ?></pubDate>
 <dc:creator><?php post_author(); ?></dc:creator>
-<guid isPermaLink="false"><?php post_id(); ?>@<?php bb_option('uri'); ?></guid>
+<guid isPermaLink="false"><?php post_id(); ?>@<?php bb_uri(); ?></guid>
 <description><?php post_text(); ?></description>
 </item>
 <?php endforeach; ?>
Index: bb-templates/kakumei/register-success.php
===================================================================
--- bb-templates/kakumei/register-success.php	(revision 912)
+++ bb-templates/kakumei/register-success.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Register'); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Register'); ?></h3>
 
 <h2 id="register"><?php _e('Great!'); ?></h2>
 
Index: bb-templates/kakumei/tag-single.php
===================================================================
--- bb-templates/kakumei/tag-single.php	(revision 912)
+++ bb-templates/kakumei/tag-single.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <a href="<?php tag_page_link(); ?>"><?php _e('Tags'); ?></a> &raquo; <?php tag_name(); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <a href="<?php tag_page_link(); ?>"><?php _e('Tags'); ?></a> &raquo; <?php tag_name(); ?></h3>
 
 <p><a href="<?php tag_rss_link(); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr> link for this tag.') ?></a></p>
 
Index: bb-templates/kakumei/stats.php
===================================================================
--- bb-templates/kakumei/stats.php	(revision 912)
+++ bb-templates/kakumei/stats.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Statistics'); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Statistics'); ?></h3>
 
 <dl>
 	<dt><?php _e('Registered Users'); ?></dt>
Index: bb-templates/kakumei/profile.php
===================================================================
--- bb-templates/kakumei/profile.php	(revision 912)
+++ bb-templates/kakumei/profile.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Profile') ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Profile') ?></h3>
 <h2 id="userlogin"><?php echo get_user_name( $user->ID ); ?></h2>
 
 <?php if ( $updated ) : ?>
Index: bb-templates/kakumei/front-page.php
===================================================================
--- bb-templates/kakumei/front-page.php	(revision 912)
+++ bb-templates/kakumei/front-page.php	(working copy)
@@ -74,7 +74,7 @@
 
 <?php else : // $forums ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a></h3>
 
 <?php post_form(); endif; // $forums ?>
 
Index: bb-templates/kakumei/search-form.php
===================================================================
--- bb-templates/kakumei/search-form.php	(revision 912)
+++ bb-templates/kakumei/search-form.php	(working copy)
@@ -1,4 +1,4 @@
-<form action="<?php bb_option('uri'); ?>search.php" method="get">
+<form action="<?php bb_uri('search.php', 'action'); ?>" method="get">
 	<p><?php _e('Search:'); ?>
 		<input type="text" size="38" maxlength="100" name="q" value="<?php echo attribute_escape( $q ); ?>" />
 	</p>
Index: bb-templates/kakumei/profile-base.php
===================================================================
--- bb-templates/kakumei/profile-base.php	(revision 912)
+++ bb-templates/kakumei/profile-base.php	(working copy)
@@ -1,6 +1,6 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php echo $profile_page_title; ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php echo $profile_page_title; ?></h3>
 <h2><?php echo get_user_name( $user->ID ); ?></h2>
 
 <?php bb_profile_base_content(); ?>
Index: bb-templates/kakumei/edit-post.php
===================================================================
--- bb-templates/kakumei/edit-post.php	(revision 912)
+++ bb-templates/kakumei/edit-post.php	(working copy)
@@ -1,5 +1,5 @@
 <?php bb_get_header(); ?>
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Edit Post'); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Edit Post'); ?></h3>
 
 <?php edit_form(); ?>
 
Index: bb-templates/kakumei/register.php
===================================================================
--- bb-templates/kakumei/register.php	(revision 912)
+++ bb-templates/kakumei/register.php	(working copy)
@@ -1,11 +1,11 @@
 <?php bb_get_header(); ?>
 
-<h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Register'); ?></h3>
+<h3 class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Register'); ?></h3>
 
 <h2 id="register"><?php _e('Registration'); ?></h2>
 
 <?php if ( !bb_is_user_logged_in() ) : ?>
-<form method="post" action="<?php bb_option('uri'); ?>register.php">
+<form method="post" action="<?php bb_uri('register.php', 'action'); ?>">
 <fieldset>
 <legend><?php _e('Profile Information'); ?></legend>
 <p><?php _e("Your password will be emailed to the address you provide."); ?></p>
Index: bb-login.php
===================================================================
--- bb-login.php	(revision 912)
+++ bb-login.php	(working copy)
@@ -3,16 +3,16 @@
 
 $ref = wp_get_referer();
 
-$re = bb_get_option('uri');
+$re = bb_get_uri();
 
-if ( 0 === strpos($ref, bb_get_option( 'uri' )) ) {
+if ( 0 === strpos($ref, bb_get_uri()) ) {
 	$re = $_POST['re'] ? $_POST['re'] : $_GET['re'];
-	if ( 0 !== strpos($re, bb_get_option( 'uri' )) )
+	if ( 0 !== strpos($re, bb_get_uri()) )
 		$re = $ref . $re;
 }
 
-if ( 0 === strpos($re, bb_get_option( 'uri' ) . 'register.php') )
-	$re = bb_get_option( 'uri' );
+if ( 0 === strpos($re, bb_get_uri('register.php')) )
+	$re = bb_get_uri();
 
 $re = clean_url( $re );
 
Index: bb-includes/akismet.php
===================================================================
--- bb-includes/akismet.php	(revision 912)
+++ bb-includes/akismet.php	(working copy)
@@ -8,7 +8,7 @@
 
 function bb_akismet_verify_key( $key ) {
 	global $bb_ksd_pre_post_status, $bb_ksd_api_host, $bb_ksd_api_port;
-	$blog = urlencode( bb_get_option('uri') );
+	$blog = urlencode( bb_get_uri(null, 'akismet') );
 	$response = bb_ksd_http_post("key=$key&blog=$blog", 'rest.akismet.com', '/1.1/verify-key', $bb_ksd_api_port);
 	if ( 'valid' == $response[1] )
 		return true;
@@ -55,7 +55,7 @@
 			return;
 
 		$_submit = array(
-			'blog' => bb_get_option('uri'),
+			'blog' => bb_get_uri(null, 'akismet'),
 			'user_ip' => $bb_post->poster_ip,
 			'permalink' => get_topic_link( $bb_post->topic_id ), // First page
 			'comment_type' => 'forum',
@@ -77,7 +77,7 @@
 			return;
 
 		$_submit = array(
-			'blog' => bb_get_option('uri'),
+			'blog' => bb_get_uri(null, 'akismet'),
 			'permalink' => get_user_profile_link( $user->ID ),
 			'comment_type' => 'profile',
 			'comment_author' => get_user_name( $user->ID ),
@@ -94,7 +94,7 @@
 		$path = '/1.1/comment-check';
 
 		$_submit = array(
-			'blog' => bb_get_option('uri'),
+			'blog' => bb_get_uri(null, 'akismet'),
 			'user_ip' => preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] ),
 			'user_agent' => $_SERVER['HTTP_USER_AGENT'],
 			'referrer' => $_SERVER['HTTP_REFERER'],
@@ -217,9 +217,9 @@
 	if ( !bb_current_user_can('moderate') )
 		return $link;
 	if ( 2 == $post_status )
-		$link .= " <a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . get_post_id() . '&status=0&view=all', 'delete-post_' . get_post_id() ) ) . "' >" . __('Not Spam') ."</a>";
+		$link .= " <a href='" . attribute_escape( bb_nonce_url( bb_get_uri('bb-admin/delete-post.php') . '?id=' . get_post_id() . '&status=0&view=all', 'delete-post_' . get_post_id() ) ) . "' >" . __('Not Spam') ."</a>";
 	else
-		$link .= " <a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . get_post_id() . '&status=2', 'delete-post_' . get_post_id() ) ) . "' >" . __('Spam') ."</a>";
+		$link .= " <a href='" . attribute_escape( bb_nonce_url( bb_get_uri('bb-admin/delete-post.php') . '?id=' . get_post_id() . '&status=2', 'delete-post_' . get_post_id() ) ) . "' >" . __('Spam') ."</a>";
 	return $link;
 }
 
Index: bb-includes/deprecated.php
===================================================================
--- bb-includes/deprecated.php	(revision 912)
+++ bb-includes/deprecated.php	(working copy)
@@ -298,12 +298,12 @@
 
 // It's not omnipotent
 function bb_path_to_url( $path ) {
-	return apply_filters( 'bb_path_to_url', bb_convert_path_base( $path, BBPATH, bb_get_option( 'uri' ) ), $path );
+	return apply_filters( 'bb_path_to_url', bb_convert_path_base( $path, BBPATH, bb_get_uri() ), $path );
 }
 
 // Neither is this one
 function bb_url_to_path( $url ) {
-	return apply_filters( 'bb_url_to_path', bb_convert_path_base( $url, bb_get_option( 'uri' ), BBPATH ), $url );
+	return apply_filters( 'bb_url_to_path', bb_convert_path_base( $url, bb_get_uri(), BBPATH ), $url );
 }
 
 function bb_convert_path_base( $path, $from_base, $to_base ) {
Index: bb-includes/pluggable.php
===================================================================
--- bb-includes/pluggable.php	(revision 912)
+++ bb-includes/pluggable.php	(working copy)
@@ -8,7 +8,7 @@
 			 (empty($_COOKIE[bb_get_option( 'usercookie' )])) ) {
 		nocache_headers();
 
-		header('Location: ' . bb_get_option('uri'));
+		header('Location: ' . bb_get_uri());
 		exit();
 	}
 }
Index: bb-includes/script-loader.php
===================================================================
--- bb-includes/script-loader.php	(revision 912)
+++ bb-includes/script-loader.php	(working copy)
@@ -61,7 +61,7 @@
 					$ver = $this->scripts[$handle]->ver ? $this->scripts[$handle]->ver : $bb_db_version;
 					if ( isset($this->args[$handle]) )
 						$ver .= '&amp;' . $this->args[$handle];
-					$src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : rtrim(bb_get_option( 'uri' ), ' /') . $this->scripts[$handle]->src;
+					$src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : rtrim(bb_get_uri(), ' /') . $this->scripts[$handle]->src;
 					$src = add_query_arg('ver', $ver, $src);
 					$src = apply_filters( 'bb_script_loader_src', $src );
 					$src = attribute_escape( $src );
Index: bb-includes/functions.php
===================================================================
--- bb-includes/functions.php	(revision 912)
+++ bb-includes/functions.php	(working copy)
@@ -1239,6 +1239,15 @@
 	return bb_delete_meta( 0, $option, $value, 'topic', true );
 }
 
+function bb_uri($file = null, $context = 'href') {
+	echo apply_filters('bb_uri', bb_get_uri($file, $context), $file, $context);
+}
+
+function bb_get_uri($file = null, $context = 'href') {
+	$uri = bb_get_option('uri') . $file;
+	return apply_filters('bb_get_uri', $uri, $file, $context);
+}
+
 // This is the only function that should add to $bb_(user||topic)_cache
 function bb_append_meta( $object, $type ) {
 	global $bbdb, $bb_table_prefix;
@@ -1867,7 +1876,7 @@
 
 function bb_nonce_ays($action) {
 	if ( !$adminurl = wp_get_referer() )
-		$adminurl = bb_get_option( 'uri' ) . '/bb-admin';
+		$adminurl = bb_get_uri('bb-admin/');
 
 	$title = wp_specialchars( __('bbPress Confirmation') );
 	$adminurl = attribute_escape( $adminurl );
@@ -1903,13 +1912,13 @@
 <head>
 	<title><?php echo $title ?></title>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-	<link rel="stylesheet" href="<?php bb_option('uri'); ?>bb-admin/install.css" type="text/css" />
+	<link rel="stylesheet" href="<?php bb_uri('bb-admin/install.css'); ?>" type="text/css" />
 <?php if ( ('rtl' == $bb_locale->text_direction) ) : ?>
-	<link rel="stylesheet" href="<?php bb_option('uri'); ?>bb-admin/install-rtl.css" type="text/css" />
+	<link rel="stylesheet" href="<?php bb_uri('bb-admin/install-rtl.css'); ?>" type="text/css" />
 <?php endif; ?>
 </head>
 <body>
-	<h1 id="logo"><img alt="bbPress" src="<?php bb_option('uri'); ?>bb-images/bbpress.png" /></h1>
+	<h1 id="logo"><img alt="bbPress" src="<?php bb_uri('bb-images/bbpress.png', 'src'); ?>" /></h1>
 <?php
 }
 
Index: bb-includes/registration-functions.php
===================================================================
--- bb-includes/registration-functions.php	(revision 912)
+++ bb-includes/registration-functions.php	(working copy)
@@ -52,7 +52,7 @@
 
 %s
 
-If you don't want to reset your password, just ignore this email. Thanks!"), bb_get_option('uri')."bb-reset-password.php?key=".$resetkey ), 'From: ' . bb_get_option('admin_email') );
+If you don't want to reset your password, just ignore this email. Thanks!"), bb_get_uri('bb-reset-password.php', 'email')."?key=".$resetkey ), 'From: ' . bb_get_option('admin_email') );
 
 	endif;
 }
@@ -110,7 +110,7 @@
 	if ( $user ) :
 		$message = __("Your username is: %1\$s \nYour password is: %2\$s \nYou can now log in: %3\$s \n\nEnjoy!");
 		mail( bb_get_user_email( $user->ID ), bb_get_option('name') . ': ' . __('Password'), 
-			sprintf( $message, "$user->user_login", "$pass", bb_get_option('uri') ), 
+			sprintf( $message, "$user->user_login", "$pass", bb_get_uri(null, 'email') ), 
 			'From: ' . bb_get_option('admin_email') 
 		);
 
Index: bb-includes/template-functions.php
===================================================================
--- bb-includes/template-functions.php	(revision 912)
+++ bb-includes/template-functions.php	(working copy)
@@ -60,7 +60,7 @@
 	if ( file_exists( $active_theme . 'style.css' ) )
 		$r = bb_get_active_theme_uri() . $css_file;
 	else
-		$r = bb_get_option( 'uri' ) . "bb-templates/kakumei/$css_file";
+		$r = bb_get_uri('bb-templates/kakumei/' . $css_file);
 	return apply_filters( 'bb_get_stylesheet_uri', $r, $stylesheet );
 }
 
@@ -80,7 +80,7 @@
 	elseif ( 0 === strpos($theme, BBTHEMEDIR) )
 		$r = BBTHEMEURL . substr($theme, strlen(BBTHEMEDIR));
 	elseif ( 0 === strpos($theme, BBPATH) )
-		$r = bb_get_option( 'uri' ) . substr($theme, strlen(BBPATH));
+		$r = bb_get_uri(substr($theme, strlen(BBPATH)));
 	else
 		$r = false;
 
@@ -153,7 +153,7 @@
 	do_action('pre_post_form');
 
 	if ( ( is_topic() && bb_current_user_can( 'write_post', $topic->topic_id ) && $page == $last_page ) || ( !is_topic() && bb_current_user_can( 'write_topic', $forum->forum_id ) ) ) {
-		echo "<form class='postform' name='postform' id='postform' method='post' action='" . bb_get_option('uri') . "bb-post.php'>\n";
+		echo "<form class='postform' name='postform' id='postform' method='post' action='" . bb_get_uri('bb-post.php', 'action') . "'>\n";
 		bb_load_template( 'post-form.php', array('h2' => $h2) );
 		bb_nonce_field( is_topic() ? 'create-post_' . $topic->topic_id : 'create-topic' );
 		if ( is_forum() )
@@ -164,7 +164,7 @@
 		echo "\n</form>";
 	} elseif ( !bb_is_user_logged_in() ) {
 		echo '<p>';
-		printf(__('You must <a href="%s">log in</a> to post.'), attribute_escape( bb_get_option('uri') . 'bb-login.php' ));
+		printf(__('You must <a href="%s">log in</a> to post.'), attribute_escape( bb_get_uri('bb-login.php') ));
 		echo '</p>';
 	}
 	do_action('post_post_form');
@@ -172,7 +172,7 @@
 
 function edit_form() {
 	global $bb_post, $topic_title;
-	echo "<form name='post' id='post' method='post' action='" . bb_get_option('uri')  . "bb-edit.php'>\n";
+	echo "<form name='post' id='post' method='post' action='" . bb_get_uri('bb-edit.php', 'action') . "'>\n";
 	bb_load_template( 'edit-form.php', array('topic_title') );
 	bb_nonce_field( 'edit-post_' . $bb_post->post_id );
 	echo "\n</form>";
@@ -325,9 +325,9 @@
 
 function get_recent_rss_link() {
 	if ( bb_get_option( 'mod_rewrite' ) )
-		$link = bb_get_option( 'uri' ) . 'rss/';
+		$link = bb_get_uri('rss/', 'rss');
 	else
-		$link = bb_get_option( 'uri' ) . "rss.php";
+		$link = bb_get_uri('rss.php', 'rss');
 	return apply_filters( 'get_recent_rss_link', $link );
 }
 
@@ -360,10 +360,10 @@
 		} else {
 			$column = 'forum_id';
 		}
-		$link = bb_get_option( 'uri' ) . "forum/" . $forum->$column . ( 1 < $page ? "/page/$page" : '' );
+		$link = bb_get_uri( 'forum/' . $forum->$column . ( 1 < $page ? '/page/' . $page : '' ) );
 	} else {
 		$args = array();
-		$link = bb_get_option( 'uri' ) . 'forum.php';
+		$link = bb_get_uri('forum.php');
 		$args['id'] = $forum->forum_id;
 		$args['page'] = 1 < $page ? $page : '';
 		$link = add_query_arg( $args, $link );
@@ -439,9 +439,9 @@
 function get_forum_rss_link( $forum_id = 0 ) {
 	$forum = get_forum( get_forum_id( $forum_id ) );
 	if ( bb_get_option('mod_rewrite') )
-		$link = bb_get_option('uri') . "rss/forum/$forum->forum_id";
+		$link = bb_get_uri('rss/forum/' . $forum->forum_id, 'rss');
 	else
-		$link = bb_get_option('uri') . "rss.php?forum=$forum->forum_id";
+		$link = bb_get_uri('rss.php', 'rss') . '?forum=' . $forum->forum_id;
 
 	return apply_filters( 'get_forum_rss_link', $link, $forum_id );
 }
@@ -555,9 +555,9 @@
 		} else {
 			$column = 'topic_id';
 		}
-		$link = bb_get_option('uri') . "topic/" . $topic->$column . ( 1 < $page ? "/page/$page" : '' );
+		$link = bb_get_uri( "topic/" . $topic->$column . ( 1 < $page ? "/page/$page" : '' ) );
 	} else {
-		$link = bb_get_option('uri') . 'topic.php';
+		$link = bb_get_uri('topic.php');
 		$args['id'] = $topic->topic_id;
 		$args['page'] = 1 < $page ? $page : '';
 	}
@@ -583,9 +583,9 @@
 	$topic = get_topic( get_topic_id( $id ) );
 
 	if ( bb_get_option('mod_rewrite') )
-		$link = bb_get_option('uri') . "rss/topic/$topic->topic_id";
+		$link = bb_get_uri('rss/topic/' . $topic->topic_id, 'rss');
 	else
-		$link = bb_get_option('uri') . "rss.php?topic=$topic->topic_id";
+		$link = bb_get_uri('rss.php', 'rss') . "?topic=$topic->topic_id";
 
 	return apply_filters( 'get_topic_rss_link', $link, $topic->topic_id );
 }
@@ -736,9 +736,9 @@
 		return;
 
 	if ( 0 == $topic->topic_status )
-		echo "$before<a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/delete-topic.php?id=' . $topic->topic_id , 'delete-topic_' . $topic->topic_id ) ) . "' onclick=\"return confirm('" . js_escape( __('Are you sure you wanna delete that?') ) . "')\">" . __('Delete entire topic') . "</a>$after";
+		echo "$before<a href='" . attribute_escape( bb_nonce_url( bb_get_uri('bb-admin/delete-topic.php') . '?id=' . $topic->topic_id , 'delete-topic_' . $topic->topic_id ) ) . "' onclick=\"return confirm('" . js_escape( __('Are you sure you wanna delete that?') ) . "')\">" . __('Delete entire topic') . "</a>$after";
 	else
-		echo "$before<a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/delete-topic.php?id=' . $topic->topic_id . '&view=all', 'delete-topic_' . $topic->topic_id ) ) . "' onclick=\"return confirm('" . js_escape( __('Are you sure you wanna undelete that?') ) . "')\">" . __('Undelete entire topic') . "</a>$after";
+		echo "$before<a href='" . attribute_escape( bb_nonce_url( bb_get_uri('bb-admin/delete-topic.php') . '?id=' . $topic->topic_id . '&view=all', 'delete-topic_' . $topic->topic_id ) ) . "' onclick=\"return confirm('" . js_escape( __('Are you sure you wanna undelete that?') ) . "')\">" . __('Undelete entire topic') . "</a>$after";
 }
 
 function topic_close_link( $args = '' ) {
@@ -752,7 +752,7 @@
 		return;
 
 	$text = topic_is_open( $topic->topic_id ) ? __('Close topic') : __('Open topic');
-	echo "$before<a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/topic-toggle.php?id=' . $topic->topic_id, 'close-topic_' . $topic->topic_id ) ) . "'>$text</a>$after";
+	echo "$before<a href='" . attribute_escape( bb_nonce_url( bb_get_uri('bb-admin/topic-toggle.php') . '?id=' . $topic->topic_id, 'close-topic_' . $topic->topic_id ) ) . "'>$text</a>$after";
 }
 
 function topic_sticky_link( $args = '' ) {
@@ -766,9 +766,9 @@
 		return;
 
 	if ( topic_is_sticky( $topic->topic_id ) )
-		echo "$before<a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/sticky.php?id=' . $topic->topic_id, 'stick-topic_' . $topic->topic_id ) ) . "'>". __('Unstick topic') ."</a>$after";
+		echo "$before<a href='" . attribute_escape( bb_nonce_url( bb_get_uri('bb-admin/sticky.php') . '?id=' . $topic->topic_id, 'stick-topic_' . $topic->topic_id ) ) . "'>". __('Unstick topic') ."</a>$after";
 	else
-		echo "$before<a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/sticky.php?id=' . $topic->topic_id, 'stick-topic_' . $topic->topic_id ) ) . "'>". __('Stick topic') . "</a> (<a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/sticky.php?id=' . $topic->topic_id . '&super=1', 'stick-topic_' . $topic->topic_id ) ) . "'>" . __('to front') . "</a>)$after";
+		echo "$before<a href='" . attribute_escape( bb_nonce_url( bb_get_uri('bb-admin/sticky.php') . '?id=' . $topic->topic_id, 'stick-topic_' . $topic->topic_id ) ) . "'>". __('Stick topic') . "</a> (<a href='" . attribute_escape( bb_nonce_url( bb_get_uri('bb-admin/sticky.php') . '?id=' . $topic->topic_id . '&super=1', 'stick-topic_' . $topic->topic_id ) ) . "'>" . __('to front') . "</a>)$after";
 }
 
 function topic_show_all_link( $id = 0 ) {
@@ -817,7 +817,7 @@
 	if ( !$dropdown )
 		return;
 
-	echo '<form id="topic-move" method="post" action="' . bb_get_option('uri') . 'bb-admin/topic-move.php"><div>' . "\n\t";
+	echo '<form id="topic-move" method="post" action="' . bb_get_uri('bb-admin/topic-move.php') . '"><div>' . "\n\t";
 	echo "<input type='hidden' name='topic_id' value='$topic->topic_id' />\n\t";
 	echo '<label for="forum_id">'. __('Move this topic to the selected forum:') . ' ';
 	echo $dropdown;
@@ -851,9 +851,9 @@
 	if ( is_forum() || is_bb_tag() )
 		$url = '#postform';
 	elseif ( is_front() )
-		$url = add_query_arg( 'new', '1', bb_get_option( 'uri' ) );
+		$url = add_query_arg( 'new', '1', bb_get_uri() );
 	if ( !bb_is_user_logged_in() )
-		$url = add_query_arg( 're', urlencode($url), bb_get_option( 'uri' ) . 'bb-login.php' );
+		$url = add_query_arg( 're', urlencode($url), bb_get_uri('bb-login.php') );
 	elseif ( is_forum() ) {
 		if ( !bb_current_user_can( 'write_topic', get_forum_id() ) )
 			return;
@@ -972,14 +972,14 @@
 function post_ip_link( $post_id = 0 ) {
 	if ( !bb_current_user_can( 'view_by_ip' ) )
 		return;
-	$link = '<a href="' . attribute_escape( bb_get_option('uri') . 'bb-admin/view-ip.php?ip=' . get_post_ip( $post_id ) ) . '">' . get_post_ip( $post_id ) . '</a>';
+	$link = '<a href="' . attribute_escape( bb_get_uri('bb-admin/view-ip.php') . '?ip=' . get_post_ip( $post_id ) ) . '">' . get_post_ip( $post_id ) . '</a>';
 	echo apply_filters( 'post_ip_link', $link, get_post_id( $post_id ) );
 }
 
 function post_edit_link( $post_id = 0 ) {
 	$bb_post = bb_get_post( get_post_id( $post_id ) );
 	if ( bb_current_user_can( 'edit_post', $bb_post->post_id ) )
-		echo "<a href='" . attribute_escape( apply_filters( 'post_edit_uri', bb_get_option('uri') . 'edit.php?id=' . $bb_post->post_id, $bb_post->post_id ) ) . "'>". __('Edit') ."</a>";
+		echo "<a href='" . attribute_escape( apply_filters( 'post_edit_uri', bb_get_uri('edit.php') . '?id=' . $bb_post->post_id, $bb_post->post_id ) ) . "'>". __('Edit') ."</a>";
 }
 
 function post_del_class( $post_id = 0 ) {
@@ -997,9 +997,9 @@
 		return;
 
 	if ( 1 == $bb_post->post_status )
-		$r = "<a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . $bb_post->post_id . '&status=0&view=all', 'delete-post_' . $bb_post->post_id ) ) . "' onclick='return confirm(\" ". js_escape( __('Are you sure you wanna undelete that?') ) ." \");'>". __('Undelete') ."</a>";
+		$r = "<a href='" . attribute_escape( bb_nonce_url( bb_get_uri('bb-admin/delete-post.php') . '?id=' . $bb_post->post_id . '&status=0&view=all', 'delete-post_' . $bb_post->post_id ) ) . "' onclick='return confirm(\" ". js_escape( __('Are you sure you wanna undelete that?') ) ." \");'>". __('Undelete') ."</a>";
 	else
-		$r = "<a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . $bb_post->post_id . '&status=1', 'delete-post_' . $bb_post->post_id ) ) . "' onclick='return ajaxPostDelete(" . $bb_post->post_id . ", \"" . get_post_author( $post_id ) . "\");'>". __('Delete') ."</a>";
+		$r = "<a href='" . attribute_escape( bb_nonce_url( bb_get_uri('bb-admin/delete-post.php') . '?id=' . $bb_post->post_id . '&status=1', 'delete-post_' . $bb_post->post_id ) ) . "' onclick='return ajaxPostDelete(" . $bb_post->post_id . ", \"" . get_post_author( $post_id ) . "\");'>". __('Delete') ."</a>";
 	$r = apply_filters( 'post_delete_link', $r, $bb_post->post_status, $bb_post->post_id );
 	echo $r;
 }
@@ -1093,9 +1093,9 @@
 		} else {
 			$column = 'ID';
 		}
-		$r = bb_get_option('uri') . "profile/" . $user->$column . ( 1 < $page ? "/page/$page" : '' );
+		$r = bb_get_uri( "profile/" . $user->$column . ( 1 < $page ? "/page/$page" : '' ) );
 	} else {
-		$r = bb_get_option('uri') . "profile.php?id=$user->ID" . ( 1 < $page ? "&page=$page" : '' );
+		$r = bb_get_uri('profile.php') . "?id=$user->ID" . ( 1 < $page ? "&page=$page" : '' );
 	}
 	return apply_filters( 'get_user_profile_link', $r, $user->ID );
 }
@@ -1328,7 +1328,7 @@
 	$args = wp_parse_args( $args, $defaults );
 	extract($args, EXTR_SKIP);
 
-	return apply_filters( 'bb_get_logout_link', "$before<a href='" . attribute_escape( bb_get_option( 'uri' ) . 'bb-login.php?logout' ) . "'>$text</a>$after", $args );
+	return apply_filters( 'bb_get_logout_link', "$before<a href='" . attribute_escape( bb_get_uri('bb-login.php') . '?logout' ) . "'>$text</a>$after", $args );
 }
 
 function bb_admin_link( $args = '' ) {
@@ -1347,7 +1347,7 @@
 	$args = wp_parse_args( $args, $defaults );
 	extract($args, EXTR_SKIP);
 
-	return apply_filters( 'bb_get_admin_link', "$before<a href='" . attribute_escape( bb_get_option( 'uri' ) . 'bb-admin/' ) . "'>$text</a>$after", $args );
+	return apply_filters( 'bb_get_admin_link', "$before<a href='" . attribute_escape( bb_get_uri('bb-admin/') ) . "'>$text</a>$after", $args );
 }
 
 function bb_profile_link( $args = '' ) {
@@ -1479,9 +1479,9 @@
 		$_tag =& $tag;
 
 	if ( bb_get_option('mod_rewrite') )
-		$link = bb_get_option('uri') . "rss/tags/$_tag->tag";
+		$link = bb_get_uri('rss/tags/' . $_tag->tag, 'rss');
 	else
-		$link = bb_get_option('uri') . "rss.php?tag=$_tag->tag";
+		$link = bb_get_uri('rss.php', 'rss') . "?tag=$_tag->tag";
 
 	return apply_filters( 'get_tag_rss_link', $link, $tag_id );
 }
@@ -1490,7 +1490,7 @@
 	global $topic;
 	if ( !bb_current_user_can( 'edit_tag_by_on', bb_get_current_user_info( 'id' ), $topic->topic_id ) )
 		return false;
-	echo "<form id='tag-form' method='post' action='" . bb_get_option('uri') . "tag-add.php'>\n";
+	echo "<form id='tag-form' method='post' action='" . bb_get_uri('tag-add.php' , 'action') . "'>\n";
 	bb_load_template( 'tag-form.php' );
 	bb_nonce_field( 'add-tag_' . $topic->topic_id );
 	echo "</form>";
@@ -1502,7 +1502,7 @@
 		return false;
 	$form  = "<ul id='manage-tags'>\n ";
 	$form .= "<li id='tag-rename'>" . __('Rename tag:') . "\n\t";
-	$form .= "<form method='post' action='" . bb_get_option('uri') . "bb-admin/tag-rename.php'><div>\n\t";
+	$form .= "<form method='post' action='" . bb_get_uri('bb-admin/tag-rename.php', 'action') . "'><div>\n\t";
 	$form .= "<input type='text' name='tag' size='10' maxlength='30' />\n\t";
 	$form .= "<input type='hidden' name='id' value='$tag->tag_id' />\n\t";
 	$form .= "<input type='submit' name='Submit' value='" . __('Rename') . "' />\n\t";
@@ -1510,7 +1510,7 @@
 	bb_nonce_field( 'rename-tag_' . $tag->tag_id );
 	echo "\n\t</div></form>\n  </li>\n ";
 	$form  = "<li id='tag-merge'>" . __('Merge this tag into:') . "\n\t";
-	$form .= "<form method='post' action='" . bb_get_option('uri') . "bb-admin/tag-merge.php'><div>\n\t";
+	$form .= "<form method='post' action='" . bb_get_uri('bb-admin/tag-merge.php', 'action') . "'><div>\n\t";
 	$form .= "<input type='text' name='tag' size='10' maxlength='30' />\n\t";
 	$form .= "<input type='hidden' name='id' value='$tag->tag_id' />\n\t";
 	$form .= "<input type='submit' name='Submit' value='" . __('Merge') . "' ";
@@ -1519,7 +1519,7 @@
 	bb_nonce_field( 'merge-tag_' . $tag->tag_id );
 	echo "\n\t</div></form>\n  </li>\n ";
 	$form  = "<li id='tag-destroy'>" . __('Destroy tag:') . "\n\t";
-	$form .= "<form method='post' action='" . bb_get_option('uri') . "bb-admin/tag-destroy.php'><div>\n\t";
+	$form .= "<form method='post' action='" . bb_get_uri('bb-admin/tag-destroy.php', 'action') . "'><div>\n\t";
 	$form .= "<input type='hidden' name='id' value='$tag->tag_id' />\n\t";
 	$form .= "<input type='submit' name='Submit' value='" . __('Destroy') . "' ";
 	$form .= 'onclick="return confirm(\'' . js_escape( sprintf(__('Are you sure you want to destroy the "%s" tag? This is permanent and cannot be undone.'), $tag->raw_tag) ) . "');\" />\n\t";
@@ -1536,7 +1536,7 @@
 	global $tag, $topic;
 	if ( !bb_current_user_can( 'edit_tag_by_on', $tag->user_id, $topic->topic_id ) )
 		return false;
-	$url = add_query_arg( array('tag' => $tag->tag_id, 'user' => $tag->user_id, 'topic' => $tag->topic_id), bb_get_option('uri') . 'tag-remove.php' );
+	$url = add_query_arg( array('tag' => $tag->tag_id, 'user' => $tag->user_id, 'topic' => $tag->topic_id), bb_get_uri('tag-remove.php') );
 	$r = '[<a href="' . attribute_escape( bb_nonce_url( $url, 'remove-tag_' . $tag->tag_id . '|' . $tag->topic_id) ) . '" onclick="return ajaxDelTag(' . $tag->tag_id . ', ' . $tag->user_id . ', \'' . js_escape($tag->raw_tag) . '\');" title="' . attribute_escape( __('Remove this tag') ) . '">x</a>]';
 	return $r;
 }
@@ -1749,9 +1749,9 @@
 	$user = bb_get_user( bb_get_user_id( $id ) );
 
 	if ( bb_get_option('mod_rewrite') )
-		$link = bb_get_option('uri') . "rss/profile/$user->ID";
+		$link = bb_get_uri('rss/profile/' . $user->ID, 'rss');
 	else
-		$link = bb_get_option('uri') . "rss.php?profile=$user->ID";
+		$link = bb_get_uri('rss.php', 'rss') . '?profile=' . $user->ID;
 
 	return apply_filters( 'get_favorites_rss_link', $link, $user->ID );
 }
@@ -1794,11 +1794,11 @@
 		$v =& $view;
 
 	if ( !array_key_exists($v, $bb_views) )
-		return bb_get_option('uri');
+		return bb_get_uri();
 	if ( bb_get_option('mod_rewrite') )
-		$link = bb_get_option('uri') . 'view/' . $v . ( 1 < $page ? "/page/$page" : '' );
+		$link = bb_get_uri( 'view/' . $v . ( 1 < $page ? '/page/' . $page : '' ) );
 	else
-		$link = bb_get_option('uri') . "view.php?view=$v" . ( 1 < $page ? "&page=$page" : '');
+		$link = bb_get_uri('view.php') . '?view=' . $v . ( 1 < $page ? '&page=' . $page : '');
 
 	return apply_filters( 'get_view_link', $link, $v, $page );
 }
Index: bb-includes/js/wp-ajax-js.php
===================================================================
--- bb-includes/js/wp-ajax-js.php	(revision 912)
+++ bb-includes/js/wp-ajax-js.php	(working copy)
@@ -19,7 +19,7 @@
 					tempObj.WPError(transport);
 			}
 		});
-		this.url = url ? url : '<?php bb_option( 'uri' ); ?>bb-admin/admin-ajax.php';
+		this.url = url ? url : '<?php bb_uri('bb-admin/admin-ajax.php'); ?>';
 		this.getResponseElement(responseEl);
 	},
 	addArg: function(key, value) {
Index: favorites.php
===================================================================
--- favorites.php	(revision 912)
+++ favorites.php	(working copy)
@@ -23,7 +23,7 @@
 		bb_remove_user_favorite( $user_id, $topic_id );
 
 	$ref = wp_get_referer();
-	if ( false !== strpos( $ref, bb_get_option('uri') ) )
+	if ( false !== strpos( $ref, bb_get_uri() ) )
 		wp_redirect( $ref );
 	else
 		wp_redirect( get_topic_link( $topic_id ) );
Index: bb-edit.php
===================================================================
--- bb-edit.php	(revision 912)
+++ bb-edit.php	(working copy)
@@ -8,7 +8,7 @@
 $bb_post  = bb_get_post( $post_id );
 
 if ( !$bb_post ) {
-	wp_redirect( bb_get_option( 'uri' ) );
+	wp_redirect( bb_get_uri() );
 	die();
 }
 
@@ -28,5 +28,5 @@
 if ($post_id)
 	wp_redirect( get_post_link( $post_id ) );
 else
-	wp_redirect( bb_get_option( 'uri' ) );
+	wp_redirect( bb_get_uri() );
 ?>
Index: bb-post.php
===================================================================
--- bb-post.php	(revision 912)
+++ bb-post.php	(working copy)
@@ -52,7 +52,7 @@
 if ($post_id)
 	wp_redirect( $link );
 else
-	wp_redirect( bb_get_option( 'uri' ) );
+	wp_redirect( bb_get_uri() );
 exit;
 
 ?>
Index: bb-admin/topic-toggle.php
===================================================================
--- bb-admin/topic-toggle.php	(revision 912)
+++ bb-admin/topic-toggle.php	(working copy)
@@ -8,7 +8,7 @@
 	bb_die(__('There is a problem with that topic, pardner.'));
 
 if ( !bb_current_user_can( 'close_topic', $topic_id ) ) {
-	wp_redirect( bb_get_option( 'uri' ) );
+	wp_redirect( bb_get_uri() );
 	exit();
 }
 
Index: bb-admin/site.php
===================================================================
--- bb-admin/site.php	(revision 912)
+++ bb-admin/site.php	(working copy)
@@ -8,7 +8,7 @@
 this unless you're upgrading from one version to another or are seeing
 pagination oddities.") ?></p>
 
-<form method="post" action="<?php bb_option('uri'); ?>bb-admin/bb-do-counts.php">
+<form method="post" action="<?php bb_uri('bb-admin/bb-do-counts.php', 'action'); ?>">
 	<fieldset>
 	<legend><?php _e('Choose items to recalculate') ?></legend>
 		<ol>
Index: bb-admin/rewrite-rules.php
===================================================================
--- bb-admin/rewrite-rules.php	(revision 912)
+++ bb-admin/rewrite-rules.php	(working copy)
@@ -4,7 +4,7 @@
 header('Content-type: text/plain');
 
 if ( !bb_current_user_can('manage_options') ) {
-	wp_redirect( bb_get_option( 'uri' ) );
+	wp_redirect( bb_get_uri() );
 	exit();
 }
 
Index: bb-admin/admin-header.php
===================================================================
--- bb-admin/admin-header.php	(revision 912)
+++ bb-admin/admin-header.php	(working copy)
@@ -3,15 +3,15 @@
 <head>
 	<title><?php bb_admin_title() ?></title>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-	<link rel="stylesheet" href="<?php bb_option('uri'); ?>bb-admin/style.css" type="text/css" />
+	<link rel="stylesheet" href="<?php bb_uri('bb-admin/style.css'); ?>" type="text/css" />
 <?php if ( 'rtl' == bb_get_option( 'text_direction' ) ) : ?>
-	<link rel="stylesheet" href="<?php bb_option('uri'); ?>bb-admin/style-rtl.css" type="text/css" />
+	<link rel="stylesheet" href="<?php bb_uri('bb-admin/style-rtl.css'); ?>" type="text/css" />
 <?php endif; do_action('bb_admin_print_scripts'); do_action( 'bb_admin_head' ); ?>
 </head>
 
 <body>
 
-<div id="top"><h1>bbPress &#8212; <a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a></h1>
+<div id="top"><h1>bbPress &#8212; <a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a></h1>
 <?php login_form(); ?>
 </div>
 <?php bb_admin_menu(); ?>
Index: bb-admin/delete-topic.php
===================================================================
--- bb-admin/delete-topic.php	(revision 912)
+++ bb-admin/delete-topic.php	(working copy)
@@ -4,7 +4,7 @@
 $topic_id = (int) $_GET['id'];
 
 if ( !bb_current_user_can( 'delete_topic', $topic_id ) ) {
-	wp_redirect( bb_get_option( 'uri' ) );
+	wp_redirect( bb_get_uri() );
 	exit();
 }
 
Index: bb-admin/view-ip.php
===================================================================
--- bb-admin/view-ip.php	(revision 912)
+++ bb-admin/view-ip.php	(working copy)
@@ -2,7 +2,7 @@
 require('admin.php');
 
 if ( !bb_current_user_can('view_by_ip') ) {
-	wp_redirect( bb_get_option( 'uri' ) );
+	wp_redirect( bb_get_uri() );
 	exit();
 }
 
Index: bb-admin/plugins.php
===================================================================
--- bb-admin/plugins.php	(revision 912)
+++ bb-admin/plugins.php	(working copy)
@@ -89,9 +89,9 @@
 			<cite><?php printf( __('By %s.'), $plugin['author_link'] ); ?></cite>
 		</td>
 <?php if ( $class ) : ?>
-		<td class="action"><a class="delete" href="<?php echo attribute_escape( bb_nonce_url( add_query_arg( array('action' => 'deactivate', 'plugin' => urlencode($p)), bb_get_option( 'uri' ) . 'bb-admin/plugins.php' ), 'deactivate-plugin_' . $p ) ); ?>">Deactivate</a></td>
+		<td class="action"><a class="delete" href="<?php echo attribute_escape( bb_nonce_url( add_query_arg( array('action' => 'deactivate', 'plugin' => urlencode($p)), bb_get_uri('bb-admin/plugins.php') ), 'deactivate-plugin_' . $p ) ); ?>">Deactivate</a></td>
 <?php else : ?>
-		<td class="action"><a class="edit" href="<?php echo attribute_escape( bb_nonce_url( add_query_arg( array('action' => 'activate', 'plugin' => urlencode($p)), bb_get_option( 'uri' ) . 'bb-admin/plugins.php' ), 'activate-plugin_' . $p ) ); ?>">Activate</a></td>
+		<td class="action"><a class="edit" href="<?php echo attribute_escape( bb_nonce_url( add_query_arg( array('action' => 'activate', 'plugin' => urlencode($p)), bb_get_uri('bb-admin/plugins.php') ), 'activate-plugin_' . $p ) ); ?>">Activate</a></td>
 <?php endif; ?>
 	</tr>
 <?php endforeach; ?>
Index: bb-admin/content-forums.php
===================================================================
--- bb-admin/content-forums.php	(revision 912)
+++ bb-admin/content-forums.php	(working copy)
@@ -17,7 +17,7 @@
 		bb_admin_notice( __('Forum Updated.') );
 		break;
 	case 'deleted' :
-		bb_admin_notice( sprintf(__('Forum deleted.  You should have bbPress <a href="%s">recount your site information</a>.'), bb_get_option( 'uri' ) . 'bb-admin/site.php') );
+		bb_admin_notice( sprintf(__('Forum deleted.  You should have bbPress <a href="%s">recount your site information</a>.'), bb_get_uri('bb-admin/site.php')) );
 		break;
 	endswitch;
 }
@@ -42,7 +42,7 @@
 		<li><?php printf(__ngettext('%d post', '%d posts', $deleted_forum->posts), $deleted_forum->posts); ?></li>
 	</ul>
 
-	<form method="post" id="delete-forums" action="<?php bb_option('uri'); ?>bb-admin/bb-forum.php">
+	<form method="post" id="delete-forums" action="<?php bb_uri('bb-admin/bb-forum.php', 'action'); ?>">
 		<p>
 			<label for="move-topics-delete"><input type="radio" name="move_topics" id="move-topics-delete" value="delete" /> <?php _e('Delete all topics and posts in this forum. <em>This can never be undone.</em>'); ?></label><br />
 			<label for="move-topics-move"><input type="radio" name="move_topics" id="move-topics-move" value="move" checked="checked" /> <?php _e('Move topics from this forum into'); ?></label>
@@ -55,7 +55,7 @@
 		</p>
 		<?php bb_nonce_field( 'delete-forums' ); ?>
 	</form>
-	<form method="get" action="<?php bb_option('uri'); ?>bb-admin/bb-forum.php">
+	<form method="get" action="<?php bb_uri('bb-admin/bb-forum.php', 'action'); ?>">s
 		<p class="submit alignleft">
 			<input type="submit" value="<?php _e('&laquo; Go back'); ?>" tabindex="10" />
 		</p>
Index: bb-admin/delete-post.php
===================================================================
--- bb-admin/delete-post.php	(revision 912)
+++ bb-admin/delete-post.php	(working copy)
@@ -4,7 +4,7 @@
 $post_id = (int) $_GET['id'];
 
 if ( !bb_current_user_can( 'delete_post', $post_id ) ) {
-	wp_redirect( bb_get_option( 'uri' ) );
+	wp_redirect( bb_get_uri() );
 	exit();
 }
 
Index: bb-admin/upgrade.php
===================================================================
--- bb-admin/upgrade.php	(revision 912)
+++ bb-admin/upgrade.php	(working copy)
@@ -23,9 +23,9 @@
 $bb_upgrade = bb_upgrade_all();
 
 if ( $bb_upgrade > 0 )
-	printf('<p>' . __('Upgrade complete.  <a href="%s">Enjoy!</a>') . '</p>', bb_get_option( 'uri' ) . 'bb-admin/' );
+	printf('<p>' . __('Upgrade complete.  <a href="%s">Enjoy!</a>') . '</p>', bb_get_uri('bb-admin/') );
 else
-	printf('<p>' . __('Nothing to upgrade.  <a href="%s">Get back to work!</a>') . '</p>', bb_get_option( 'uri' ) . 'bb-admin/' );
+	printf('<p>' . __('Nothing to upgrade.  <a href="%s">Get back to work!</a>') . '</p>', bb_get_uri('bb-admin/') );
 
 printf('<p>' . __('%1$d queries and %2$s seconds.') . '</p>', $bbdb->num_queries, bb_timer_stop(0));
 
Index: bb-admin/admin.php
===================================================================
--- bb-admin/admin.php	(revision 912)
+++ bb-admin/admin.php	(working copy)
@@ -4,7 +4,7 @@
 bb_auth();
 
 if ( bb_get_option( 'bb_db_version' ) != bb_get_option_from_db( 'bb_db_version' ) )
-	bb_die( sprintf(__("Your database is out-of-date.  Please <a href='%s'>upgrade</a>."), bb_get_option( 'uri' ) . 'bb-admin/upgrade.php') );
+	bb_die( sprintf(__("Your database is out-of-date.  Please <a href='%s'>upgrade</a>."), bb_get_uri('bb-admin/upgrade.php')) );
 
 require('admin-functions.php');
 require('admin-deprecated.php');
Index: bb-admin/admin-functions.php
===================================================================
--- bb-admin/admin-functions.php	(revision 912)
+++ bb-admin/admin-functions.php	(working copy)
@@ -108,7 +108,7 @@
 		}
 	endif;
 	if ( $bb_current_submenu && !bb_current_user_can( $bb_current_submenu[1] ) || !bb_current_user_can( $bb_current_menu[1] ) ) {
-		wp_redirect( bb_get_option( 'uri' ) );
+		wp_redirect( bb_get_uri() );
 		exit();
 	}
 }
@@ -525,9 +525,9 @@
 	$r .= "\t\t<div class='list-block posrel'>\n";
 	$r .= "\t\t\t<div class='alignright'>\n";
 	if ( bb_current_user_can( 'manage_forums' ) )
-		$r .= "\t\t\t\t<a class='edit' href='" . attribute_escape( bb_get_option('uri') . "bb-admin/content-forums.php?action=edit&id=$_forum->forum_id" ) . "'>" . __('Edit') . "</a>\n";
+		$r .= "\t\t\t\t<a class='edit' href='" . attribute_escape( bb_get_uri('bb-admin/content-forums.php') . "?action=edit&id=$_forum->forum_id" ) . "'>" . __('Edit') . "</a>\n";
 	if ( bb_current_user_can( 'delete_forum', $_forum->forum_id ) && 1 < $forums_count )
-		$r .= "\t\t\t\t<a class='delete' href='" . attribute_escape( bb_get_option('uri') . "bb-admin/content-forums.php?action=delete&id=$_forum->forum_id" ) . "'>" . __('Delete') . "</a>\n";
+		$r .= "\t\t\t\t<a class='delete' href='" . attribute_escape( bb_get_uri('bb-admin/content-forums.php') . "?action=delete&id=$_forum->forum_id" ) . "'>" . __('Delete') . "</a>\n";
 	$r .= "\t\t\t</div>\n";
 	$r .= "\t\t\t" . get_forum_name( $_forum->forum_id ) . ' &#8212; ' . get_forum_description( $_forum->forum_id ) . "\n\t\t</div>\n";
 	if ( $close )
@@ -544,7 +544,7 @@
 		return;
 	$action = $forum_id ? 'update' : 'add';
 ?>
-<form method="post" id="<?php echo $action; ?>-forum" action="<?php bb_option('uri'); ?>bb-admin/bb-forum.php">
+<form method="post" id="<?php echo $action; ?>-forum" action="<?php bb_uri('bb-admin/bb-forum.php', 'action'); ?>">
 	<fieldset>
 	<table><col /><col style="width: 80%" />
 		<tr><th scope="row"><?php _e('Forum Name:'); ?></th>
Index: bb-admin/tag-destroy.php
===================================================================
--- bb-admin/tag-destroy.php	(revision 912)
+++ bb-admin/tag-destroy.php	(working copy)
@@ -16,7 +16,7 @@
 if ( $destroyed = destroy_tag( $tag_id ) ) {
 	printf(__("Rows deleted from tags table: %d <br />\n"), $destroyed['tags']);
 	printf(__("Rows deleted from tagged table: %d <br />\n"), $destroyed['tagged']);
-	printf(__('<a href="%s">Home</a>'), bb_get_option( 'uri' ));
+	printf(__('<a href="%s">Home</a>'), bb_get_uri());
 } else {
    die(printf(__("Something odd happened when attempting to destroy that tag.<br />\n<a href=\"%s\">Try Again?</a>"), wp_get_referer()));
 }
Index: bb-admin/sticky.php
===================================================================
--- bb-admin/sticky.php	(revision 912)
+++ bb-admin/sticky.php	(working copy)
@@ -9,7 +9,7 @@
 	bb_die(__('There is a problem with that topic, pardner.'));
 
 if ( !bb_current_user_can( 'stick_topic', $topic_id ) ) {
-	wp_redirect( bb_get_option( 'uri' ) );
+	wp_redirect( bb_get_uri() );
 	exit();
 }
 
Index: bb-admin/install.php
===================================================================
--- bb-admin/install.php	(revision 912)
+++ bb-admin/install.php	(working copy)
@@ -32,7 +32,7 @@
 		$user->set_role( 'keymaster' ); ?>
 
 <p><?php printf(__('%s is now a Key Master'), $user->data->user_login); ?></p>
-<p><a href="<?php bb_option( 'uri' ); ?>"><?php _e('Back to the front page'); ?></a></p>
+<p><a href="<?php bb_uri(); ?>"><?php _e('Back to the front page'); ?></a></p>
 
 <?php	else : ?>
 
@@ -292,7 +292,7 @@
 
 --The bbPress Team
 http://bbpress.org/
-"), bb_get_option( 'uri' ), $admin_login, $password);
+"), bb_get_uri(), $admin_login, $password);
 
 @mail(bb_get_option( 'admin_email' ), __('New bbPress installation'), $message, $message_headers);?>
 
Index: bb-admin/bb-forum.php
===================================================================
--- bb-admin/bb-forum.php	(revision 912)
+++ bb-admin/bb-forum.php	(working copy)
@@ -5,7 +5,7 @@
 	bb_die(__("You don't have the authority to mess with the forums."));
 
 if ( !isset($_POST['action']) )
-	wp_redirect( bb_get_option( 'uri' ) . 'bb-admin/content-forums.php' );
+	wp_redirect( bb_get_uri('bb-admin/content-forums.php') );
 
 $sent_from = wp_get_referer();
 
Index: bb-admin/topic-move.php
===================================================================
--- bb-admin/topic-move.php	(revision 912)
+++ bb-admin/topic-move.php	(working copy)
@@ -8,7 +8,7 @@
 	bb_die(__('Invalid topic or forum.'));
 
 if ( !bb_current_user_can( 'move_topic', $topic_id, $forum_id ) ) {
-	wp_redirect( bb_get_option( 'uri' ) );
+	wp_redirect( bb_get_uri() );
 	exit();
 }
 
Index: bb-admin/themes.php
===================================================================
--- bb-admin/themes.php	(revision 912)
+++ bb-admin/themes.php	(working copy)
@@ -3,13 +3,13 @@
 
 if ( isset($_GET['theme']) ) {
 	if ( !bb_current_user_can( 'use_keys' ) ) {
-		wp_redirect( bb_get_option( 'uri' ) );
+		wp_redirect( bb_get_uri() );
 		exit;
 	}
 	bb_check_admin_referer( 'switch-theme' );
 	$activetheme = stripslashes($_GET['theme']);
 	bb_update_option( 'bb_active_theme', $activetheme );
-	wp_redirect( bb_get_option( 'uri' ) . 'bb-admin/themes.php?activated' );
+	wp_redirect( bb_get_uri('bb-admin/themes.php') . '?activated' );
 	exit;
 } 
 
@@ -29,7 +29,7 @@
 function bb_admin_theme_row( $theme ) {
 	$theme_data = file_exists( $theme . 'style.css' ) ? bb_get_theme_data( $theme . 'style.css' ) : false;
 	$screen_shot = file_exists( $theme . 'screenshot.png' ) ? clean_url( bb_get_theme_uri( $theme . 'screenshot.png' ) ) : false;
-	$activation_url = clean_url( bb_nonce_url( add_query_arg( 'theme', urlencode($theme), bb_get_option( 'uri' ) . 'bb-admin/themes.php' ), 'switch-theme' ) );
+	$activation_url = clean_url( bb_nonce_url( add_query_arg( 'theme', urlencode($theme), bb_get_uri('bb-admin/themes.php') ), 'switch-theme' ) );
 ?>
 	<li<?php alt_class( 'theme', $class ); ?>>
 		<div class="screen-shot"><?php if ( $screen_shot ) : ?><a href="<?php echo $activation_url; ?>" title="<?php echo attribute_escape( __('Click to activate') ); ?>"><img alt="<?php echo attribute_escape( $theme_data['Title'] ); ?>" src="<?php echo $screen_shot; ?>" /></a><?php endif; ?></div>
Index: profile-edit.php
===================================================================
--- profile-edit.php	(revision 912)
+++ profile-edit.php	(working copy)
@@ -4,7 +4,7 @@
 bb_auth();
 
 if ( !bb_current_user_can( 'edit_user', $user_id ) ) {
-	$sendto = bb_get_option('uri');
+	$sendto = bb_get_uri();
 	wp_redirect( $sendto );
 }
 
@@ -48,7 +48,7 @@
 	if ( bb_current_user_can('edit_users') ):
 		if ( isset($_POST['delete-user']) && $_POST['delete-user'] && $bb_current_id != $user->ID ) :
 			bb_delete_user( $user->ID );
-			wp_redirect( bb_get_option( 'uri' ) );
+			wp_redirect( bb_get_uri() );
 			exit;
 		endif;
 		$role = $_POST['role'];
Index: edit.php
===================================================================
--- edit.php	(revision 912)
+++ edit.php	(working copy)
@@ -8,7 +8,7 @@
 $bb_post  = bb_get_post( $post_id );
 
 if ( !$bb_post || !bb_current_user_can( 'edit_post', $post_id ) ) {
-	wp_redirect( bb_get_option( 'uri' ) );
+	wp_redirect( bb_get_uri() );
 	die();
 }
 
