title: WordPress: Issues with wp-includes/canonical.php Undefined Index in Host
body: <p>Just had my server rebooted and now five errors, all related to canonical.php in the wp-includes folder show up:</p>
  
  <pre><code>[Sun Sep 22 19:55:37.037647 2019] [php7:notice] PHP Notice:  Undefined index: host in /www/webroot/cafed/wordpress/wp-includes/canonical.php on line 507
  [Sun Sep 22 19:55:37.037679 2019] [php7:notice] PHP Notice:  Undefined index: host in /www/webroot/cafed/wordpress/wp-includes/canonical.php on line 508
  [Sun Sep 22 19:55:37.037702 2019] [php7:notice] PHP Notice:  Undefined index: host in /www/webroot/cafed/wordpress/wp-includes/canonical.php on line 508
  [Sun Sep 22 19:55:37.037708 2019] [php7:notice] PHP Notice:  Undefined index: host in /www/webroot/cafed/wordpress/wp-includes/canonical.php on line 509
  [Sun Sep 22 19:55:37.037714 2019] [php7:notice] PHP Notice:  Undefined index: host in /www/webroot/cafed/wordpress/wp-includes/canonical.php on line 512
  </code></pre>
  
  <p>That seems to relate to this piece of code:</p>
  
  <pre><code>// Ignore differences in host capitalization, as this can lead to infinite redirects
  // Only redirect no-www &lt;=&gt; yes-www
  if ( strtolower( $original['host'] ) == strtolower( $redirect['host'] ) ||
      ( strtolower( $original['host'] ) != 'www.' . strtolower( $redirect['host'] ) &amp;&amp; 'www.' . strtolower( $original['host'] ) != strtolower( $redirect['host'] ) ) ) {
      $redirect['host'] = $original['host'];
  }
  
  $compare_original = array( $original['host'], $original['path'] );
  </code></pre>
  
  <p>Seems to have something related to non-www vs www domains.</p>
  
  <p>Any idea how to correct this?</p>