Index: src/wp-includes/canonical.php
--- src/wp-includes/canonical.php
+++ src/wp-includes/canonical.php
@@ -77,18 +77,21 @@
 		return;
 	}
 
-	$redirect     = $original;
-	$redirect_url = false;
-	$redirect_obj = false;
-
 	// Notice fixing.
-	if ( ! isset( $redirect['path'] ) ) {
-		$redirect['path'] = '';
+	if ( ! isset( $original['host'] ) ) {
+		$original['host'] = '';
 	}
-	if ( ! isset( $redirect['query'] ) ) {
-		$redirect['query'] = '';
+	if ( ! isset( $original['path'] ) ) {
+		$original['path'] = '';
 	}
+	if ( ! isset( $original['query'] ) ) {
+		$original['query'] = '';
+	}
 
+	$redirect     = $original;
+	$redirect_url = false;
+	$redirect_obj = false;
+
 	/*
 	 * If the original URL ended with non-breaking spaces, they were almost
 	 * certainly inserted by accident. Let's remove them, so the reader doesn't
@@ -616,6 +619,9 @@
 	}
 
 	// Notice prevention after new parse_url( $redirect_url ) calls
+	if ( ! isset( $redirect['host'] ) ) {
+		$redirect['host'] = '';
+	}
 	if ( ! isset( $redirect['path'] ) ) {
 		$redirect['path'] = '';
 	}
