diff --git a/src/wp-includes/canonical.php b/src/wp-includes/canonical.php
index 6faeab2c27..42277040f0 100644
--- a/src/wp-includes/canonical.php
+++ b/src/wp-includes/canonical.php
@@ -261,6 +261,15 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
 			if ( $redirect_url ) {
 				$redirect['query'] = remove_query_arg( 'page_id', $redirect['query'] );
 			}
+		} elseif ( is_page() && ! empty( $_GET['pagename'] ) && ! get_query_var( 'paged' ) && ! $redirect_url ) {
+			$redirect_url = get_permalink( $wp_query->get_queried_object_id() );
+			$redirect_obj = get_post( $wp_query->get_queried_object_id() );
+
+			if ( $redirect_url ) {
+				// Feeds and comment pages are appended to this path further down.
+				$redirect['path']  = parse_url( $redirect_url, PHP_URL_PATH );
+				$redirect['query'] = remove_query_arg( 'pagename', $redirect['query'] );
+			}
 		} elseif ( is_page() && ! is_feed() && ! $redirect_url
 			&& 'page' === get_option( 'show_on_front' ) && get_queried_object_id() === (int) get_option( 'page_on_front' )
 		) {
@@ -274,6 +283,17 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
 			if ( $redirect_url ) {
 				$redirect['query'] = remove_query_arg( 'page_id', $redirect['query'] );
 			}
+		} elseif ( is_home() && ! empty( $_GET['pagename'] ) && ! is_feed() && ! $redirect_url
+			&& 'page' === get_option( 'show_on_front' ) && $wp_query->get_queried_object_id() === (int) get_option( 'page_for_posts' )
+		) {
+			$redirect_url = get_permalink( get_option( 'page_for_posts' ) );
+			$redirect_obj = get_post( get_option( 'page_for_posts' ) );
+
+			if ( $redirect_url ) {
+				// Paging is appended to this path further down.
+				$redirect['path']  = parse_url( $redirect_url, PHP_URL_PATH );
+				$redirect['query'] = remove_query_arg( 'pagename', $redirect['query'] );
+			}
 		} elseif ( ! empty( $_GET['m'] ) && ( is_year() || is_month() || is_day() ) ) {
 			$m = get_query_var( 'm' );
 
@@ -317,8 +337,9 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
 					$redirect['query'] = remove_query_arg( 'year', $redirect['query'] );
 				}
 			}
-		} elseif ( is_author() && ! empty( $_GET['author'] )
-			&& is_string( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] )
+		} elseif ( is_author()
+			&& ( ( ! empty( $_GET['author'] ) && is_string( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] ) )
+				|| ( ! empty( $_GET['author_name'] ) && is_string( $_GET['author_name'] ) ) )
 		) {
 			$author = get_userdata( get_query_var( 'author' ) );
 
@@ -329,7 +350,9 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
 				$redirect_obj = $author;
 
 				if ( $redirect_url ) {
-					$redirect['query'] = remove_query_arg( 'author', $redirect['query'] );
+					// Paging and feeds are appended to this path further down.
+					$redirect['path']  = parse_url( $redirect_url, PHP_URL_PATH );
+					$redirect['query'] = remove_query_arg( array( 'author', 'author_name' ), $redirect['query'] );
 				}
 			}
 		} elseif ( is_category() || is_tag() || is_tax() ) { // Terms (tags/categories).
@@ -367,6 +390,14 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
 
 						$rewrite_vars = array_diff( array_keys( $wp_query->query ), array_keys( $_GET ) );
 
+						/*
+						 * _post_format_request() adds a `post_type` query var to every post format request.
+						 * It is not part of the requested URL, so it does not come from the rewrite rules.
+						 */
+						if ( 'post_format' === $obj->taxonomy ) {
+							$rewrite_vars = array_diff( $rewrite_vars, array( 'post_type' ) );
+						}
+
 						// Check to see if all the query vars are coming from the rewrite, none are set via $_GET.
 						if ( ! array_diff( $rewrite_vars, array_keys( $_GET ) ) ) {
 							// Remove all of the per-tax query vars.
diff --git a/tests/phpunit/includes/testcase-canonical.php b/tests/phpunit/includes/testcase-canonical.php
index 33dbb3d9f4..f0f2785d2f 100644
--- a/tests/phpunit/includes/testcase-canonical.php
+++ b/tests/phpunit/includes/testcase-canonical.php
@@ -54,7 +54,7 @@ abstract class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
 		// Already created by install defaults:
 		// $factory->term->create( array( 'taxonomy' => 'category', 'name' => 'uncategorized' ) );
 
-		self::$post_ids[] = $factory->post->create(
+		$audio_post_id = $factory->post->create(
 			array(
 				'import_id'  => 587,
 				'post_title' => 'post-format-test-audio',
@@ -62,6 +62,10 @@ abstract class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
 			)
 		);
 
+		set_post_format( $audio_post_id, 'audio' );
+
+		self::$post_ids[] = $audio_post_id;
+
 		$gallery_post_id = $factory->post->create(
 			array(
 				'post_title' => 'post-format-test-gallery',
diff --git a/tests/phpunit/tests/canonical.php b/tests/phpunit/tests/canonical.php
index 886b093129..b0e0d76311 100644
--- a/tests/phpunit/tests/canonical.php
+++ b/tests/phpunit/tests/canonical.php
@@ -148,6 +148,12 @@ class Tests_Canonical extends WP_Canonical_UnitTestCase {
 			// Taxonomies with extra query vars.
 			array( '/category/cat-a/page/1/?test=one%20two', '/category/cat-a/?test=one%20two', 18086 ), // Extra query vars should stay encoded.
 
+			// Post formats.
+			array( '/?post_format=audio', '/type/audio/', 20902 ),
+			array( '/?post_format=audio&test=one', '/type/audio/?test=one', 20902 ), // Extra query vars should be kept.
+			array( '/type/audio/', '/type/audio/', 20902 ), // No redirect.
+			array( '/?post_format=video', '/?post_format=video', 20902 ), // A format without posts is a 404: no redirect.
+
 			// Categories with dates.
 			array(
 				'/2008/04/?cat=1',
@@ -177,6 +183,12 @@ class Tests_Canonical extends WP_Canonical_UnitTestCase {
 			// Pages.
 			array( '/child-page-1/', '/parent-page/child-page-1/' ),
 			array( '/?page_id=144', '/parent-page/child-page-1/' ),
+			array( '/?pagename=sample-page', '/sample-page/', 20902 ),
+			array( '/?pagename=sample-page&test=one', '/sample-page/?test=one', 20902 ), // Extra query vars should be kept.
+			array( '/?pagename=parent/child1/grandchild', '/parent/child1/grandchild/', 20902 ), // Hierarchical page path.
+			array( '/?pagename=does-not-exist', '/?pagename=does-not-exist', 20902 ), // A page that does not exist is a 404: no redirect.
+			array( '/?pagename=sample-page&feed=rss2', '/sample-page/feed/', 20902 ),
+			array( '/?pagename=sample-page&paged=2', '/page/2/?pagename=sample-page', 20902 ), // Paging does not apply to a page: unchanged, the page name is not dropped.
 			array( '/abo', '/about/' ),
 			array( '/parent/child1/grandchild/', '/parent/child1/grandchild/' ),
 			array( '/parent/child2/grandchild/', '/parent/child2/grandchild/' ),
@@ -238,6 +250,14 @@ class Tests_Canonical extends WP_Canonical_UnitTestCase {
 
 			// Authors.
 			array( '/?author=%d', '/author/canonical-author/' ),
+			array( '/?author_name=canonical-author', '/author/canonical-author/', 20902 ),
+			array( '/?author_name=canonical-author&test=one', '/author/canonical-author/?test=one', 20902 ), // Extra query vars should be kept.
+			array( '/?author_name=does-not-exist', '/?author_name=does-not-exist', 20902 ), // No such author: no redirect.
+			// Paging and feeds should be added to the author URL, not replace it.
+			array( '/?author_name=canonical-author&paged=1', '/author/canonical-author/', 20902 ),
+			array( '/?author_name=canonical-author&paged=2', '/author/canonical-author/page/2/', 20902 ),
+			array( '/?author_name=canonical-author&feed=rss2', '/author/canonical-author/feed/', 20902 ),
+			array( '/?author=%d&paged=2', '/author/canonical-author/page/2/', 20902 ),
 			// array( '/?author=%d&year=2008', '/2008/?author=3'),
 			// array( '/author/canonical-author/?year=2008', '/2008/?author=3'), // Either or, see previous testcase.
 			array( '/author/canonical-author/?author[1]=hello', '/author/canonical-author/?author[1]=hello', 60059 ),
@@ -267,6 +287,55 @@ class Tests_Canonical extends WP_Canonical_UnitTestCase {
 		);
 	}
 
+	/**
+	 * A `?author_name=` request for a user without published posts should not be redirected,
+	 * the same as a `?author=` request for that user.
+	 *
+	 * @ticket 20902
+	 *
+	 * @dataProvider data_author_query_vars_without_published_posts
+	 *
+	 * @param string $query_var The author query var to test, either `author` or `author_name`.
+	 */
+	public function test_author_query_var_without_published_posts_is_not_redirected( $query_var ) {
+		$user_id = self::factory()->user->create( array( 'user_login' => 'author-without-posts' ) );
+
+		$test_url = ( 'author' === $query_var ) ? "/?author={$user_id}" : '/?author_name=author-without-posts';
+
+		$this->assertCanonical( $test_url, $test_url, 20902 );
+	}
+
+	/**
+	 * Data provider.
+	 *
+	 * @return array[]
+	 */
+	public function data_author_query_vars_without_published_posts() {
+		return array(
+			'author'      => array( 'author' ),
+			'author_name' => array( 'author_name' ),
+		);
+	}
+
+	/**
+	 * Paging and feeds of a `?post_format=` request should be added to the post format URL.
+	 *
+	 * @ticket 20902
+	 */
+	public function test_post_format_query_var_with_paging_and_feed() {
+		// Together with the audio post from the fixtures, this gives two pages of audio posts.
+		$post_ids = self::factory()->post->create_many( 5, array( 'post_date' => '2008-07-01 00:00:00' ) );
+
+		foreach ( $post_ids as $post_id ) {
+			set_post_format( $post_id, 'audio' );
+		}
+
+		$this->assertCanonical( '/?post_format=audio&paged=1', '/type/audio/', 20902 );
+		$this->assertCanonical( '/?post_format=audio&paged=2', '/type/audio/page/2/', 20902 );
+		$this->assertCanonical( '/?post_format=audio&paged=2&test=one', '/type/audio/page/2/?test=one', 20902 );
+		$this->assertCanonical( '/?post_format=audio&feed=rss2', '/type/audio/feed/', 20902 );
+	}
+
 	/**
 	 * @ticket 16557
 	 */
diff --git a/tests/phpunit/tests/canonical/pageOnFront.php b/tests/phpunit/tests/canonical/pageOnFront.php
index e8833dd660..81c0495cfb 100644
--- a/tests/phpunit/tests/canonical/pageOnFront.php
+++ b/tests/phpunit/tests/canonical/pageOnFront.php
@@ -66,6 +66,17 @@ class Tests_Canonical_PageOnFront extends WP_Canonical_UnitTestCase {
 			array( '/blog-page/?page=2', '/blog-page/', 45337 ),
 			// The posts page supports regular pagination.
 			array( '/blog-page/?paged=2', '/blog-page/page/2/', 20385 ),
+
+			// The `pagename` query var of the front page should redirect to the front of the site.
+			array( '/?pagename=front-page', '/', 20902 ),
+			array( '/?pagename=front-page&test=one', '/?test=one', 20902 ),
+			// The front page supports the <!--nextpage--> pagination.
+			array( '/?pagename=front-page&page=2', '/page/2/', 20902 ),
+			// The `pagename` query var of the posts page should redirect to the pretty permalink.
+			array( '/?pagename=blog-page', '/blog-page/', 20902 ),
+			array( '/?pagename=blog-page&test=one', '/blog-page/?test=one', 20902 ),
+			// The posts page supports regular pagination.
+			array( '/?pagename=blog-page&paged=2', '/blog-page/page/2/', 20902 ),
 		);
 	}
 }
