Index: src/wp-includes/canonical.php
===================================================================
--- src/wp-includes/canonical.php	(revision 36237)
+++ src/wp-includes/canonical.php	(working copy)
@@ -438,48 +438,57 @@ function redirect_canonical( $requested_
 	// Always trailing slash the Front Page URL
 	if ( trailingslashit( $redirect['path'] ) == trailingslashit( $user_home['path'] ) )
 		$redirect['path'] = trailingslashit($redirect['path']);
 
 	// Ignore differences in host capitalization, as this can lead to infinite redirects
 	// Only redirect no-www <=> yes-www
 	if ( strtolower($original['host']) == strtolower($redirect['host']) ||
 		( strtolower($original['host']) != 'www.' . strtolower($redirect['host']) && 'www.' . strtolower($original['host']) != strtolower($redirect['host']) ) )
 		$redirect['host'] = $original['host'];
 
 	$compare_original = array( $original['host'], $original['path'] );
 
 	if ( !empty( $original['port'] ) )
 		$compare_original[] = $original['port'];
 
+	if ( !empty($original['path']) )
+		$compare_original[] = $original['path'];
+
 	if ( !empty( $original['query'] ) )
 		$compare_original[] = $original['query'];
 
 	$compare_redirect = array( $redirect['host'], $redirect['path'] );
 
 	if ( !empty( $redirect['port'] ) )
 		$compare_redirect[] = $redirect['port'];
 
+	if ( !empty($redirect['path']) )
+		$compare_redirect[] = $redirect['path'];
+
 	if ( !empty( $redirect['query'] ) )
 		$compare_redirect[] = $redirect['query'];
 
 	if ( $compare_original !== $compare_redirect ) {
 		$redirect_url = $redirect['scheme'] . '://' . $redirect['host'];
 		if ( !empty($redirect['port']) )
 			$redirect_url .= ':' . $redirect['port'];
 		$redirect_url .= $redirect['path'];
 		if ( !empty($redirect['query']) )
 			$redirect_url .= '?' . $redirect['query'];
+	} else {
+		// No changes between the two URLs were detected.
+		return;
 	}
 
 	if ( ! $redirect_url || $redirect_url == $requested_url ) {
 		return;
 	}
 
 	// Hex encoded octets are case-insensitive.
 	if ( false !== strpos($requested_url, '%') ) {
 		if ( !function_exists('lowercase_octets') ) {
 			function lowercase_octets($matches) {
 				return strtolower( $matches[0] );
 			}
 		}
 		$requested_url = preg_replace_callback('|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url);
 	}
Index: tests/phpunit/includes/testcase-canonical.php
===================================================================
--- tests/phpunit/includes/testcase-canonical.php	(revision 36236)
+++ tests/phpunit/includes/testcase-canonical.php	(working copy)
@@ -169,66 +169,87 @@ class WP_Canonical_UnitTestCase extends 
 		$this->expected_doing_it_wrong = array_merge( $this->expected_doing_it_wrong, (array) $expected_doing_it_wrong );
 
 		if ( $ticket )
 			$this->knownWPBug( $ticket );
 
 		$ticket_ref = ($ticket > 0) ? 'Ticket #' . $ticket : null;
 
 		if ( is_string($expected) )
 			$expected = array('url' => $expected);
 		elseif ( is_array($expected) && !isset($expected['url']) && !isset($expected['qv']) )
 			$expected = array( 'qv' => $expected );
 
 		if ( !isset($expected['url']) && !isset($expected['qv']) )
 			$this->markTestSkipped('No valid expected output was provided');
 
-		$this->go_to( home_url( $test_url ) );
+		// FQDN it.
+		$test_url = home_url( $test_url );
+
+		$this->go_to( $test_url );
 
 		// Does the redirect match what's expected?
 		$can_url = $this->get_canonical( $test_url );
 		$parsed_can_url = parse_url($can_url);
 
-		// Just test the Path and Query if present
+		// Test the url components individually.
+		if ( isset($expected['url']) ) {
+			$this->assertEquals( WP_TESTS_DOMAIN, $parsed_can_url['host'] );
+			$this->assertEquals( $expected['url'], $parsed_can_url['path'] . (!empty($parsed_can_url['query']) ? '?' . $parsed_can_url['query'] : ''), $ticket_ref );
+		}
+
+		// Try the request again, but this time with a capitalised hostname.
+		add_filter( 'home_url', array( $this, '_filter_url_to_uppercase' ) );
+		$can_url = $this->get_canonical( $test_url );
+		$parsed_can_url = parse_url($can_url);
+
+		// Test the url components individually.
 		if ( isset($expected['url']) ) {
+			$this->assertEquals( WP_TESTS_DOMAIN, $parsed_can_url['host'] );
 			$this->assertEquals( $expected['url'], $parsed_can_url['path'] . (!empty($parsed_can_url['query']) ? '?' . $parsed_can_url['query'] : ''), $ticket_ref );
 		}
 
 		if ( ! isset($expected['qv']) )
 			return;
 
 		// "make" that the request and check the query is correct
 		$this->go_to( $can_url );
 
 		// Are all query vars accounted for, And correct?
 		global $wp;
 
 		$query_vars = array_diff($wp->query_vars, $wp->extra_query_vars);
 		if ( !empty($parsed_can_url['query']) ) {
 			parse_str($parsed_can_url['query'], $_qv);
 
 			// $_qv should not contain any elements which are set in $query_vars already (ie. $_GET vars should not be present in the Rewrite)
 			$this->assertEquals( array(), array_intersect( $query_vars, $_qv ), 'Query vars are duplicated from the Rewrite into $_GET; ' . $ticket_ref );
 
 			$query_vars = array_merge($query_vars, $_qv);
 		}
 
 		$this->assertEquals( $expected['qv'], $query_vars );
 	}
 
 	/**
 	 * Get the canonical URL given a raw URL.
 	 *
-	 * @param string $test_url Should be relative to the site "front", ie /category/uncategorized/
-	 *                         as opposed to http://example.com/category/uncategorized/
+	 * @param string $test_url Should be an absolute url ie. http://example.com/category/uncategorized/
 	 * @return $can_url Returns the original $test_url if no canonical can be generated, otherwise returns
 	 *                  the fully-qualified URL as generated by redirect_canonical().
 	 */
 	public function get_canonical( $test_url ) {
-		$test_url = home_url( $test_url );
-
 		$can_url = redirect_canonical( $test_url, false );
 		if ( ! $can_url )
 			return $test_url; // No redirect will take place for this request
 
 		return $can_url;
 	}
+
+	/**
+	 * Filters the Site URL to uppercase.
+	 * Used to 
+	 */
+	public function _filter_url_to_uppercase( $url ) {
+		return str_replace( 'http://' . WP_TESTS_DOMAIN . '/', 'http://' . strtoupper( WP_TESTS_DOMAIN ) . '/', $url );
+	}
+
 }
Index: tests/phpunit/tests/canonical/pageOnFront.php
===================================================================
--- tests/phpunit/tests/canonical/pageOnFront.php	(revision 36238)
+++ tests/phpunit/tests/canonical/pageOnFront.php	(working copy)
@@ -32,24 +32,25 @@ class Tests_Canonical_PageOnFront extend
 	function data() {
 		/* Format:
 		 * [0]: $test_url,
 		 * [1]: expected results: Any of the following can be used
 		 *      array( 'url': expected redirection location, 'qv': expected query vars to be set via the rewrite AND $_GET );
 		 *      array( expected query vars to be set, same as 'qv' above )
 		 *      (string) expected redirect location
 		 * [3]: (optional) The ticket the test refers to, Can be skipped if unknown.
 		 */
 		 return array(
 			// Check against an odd redirect
 			array( '/page/2/', '/page/2/' ),
 			array( '/?page=2', '/page/2/' ),
 			array( '/page/1/', '/' ),
 			array( '/?page=1', '/' ),
+			array( '/', '/', 21602 ),
 
 			// The page designated as the front page should redirect to the front of the site
 			array( '/front-page/', '/' ),
 			array( '/front-page/2/', '/page/2/' ),
 			array( '/front-page/?page=2', '/page/2/' ),
 			array( '/blog-page/?paged=2', '/blog-page/page/2/' ),
 		 );
 	}
 }
