[wp-trac] [WordPress Trac] #32229: redirect_canonical - Undefined Index HTTP_HOST

WordPress Trac noreply at wordpress.org
Fri May 1 20:48:27 UTC 2015


#32229: redirect_canonical - Undefined Index HTTP_HOST
-------------------------------------------+-----------------------------
 Reporter:  Howdy_McGee                    |      Owner:
     Type:  defect (bug)                   |     Status:  new
 Priority:  normal                         |  Milestone:  Awaiting Review
Component:  Canonical                      |    Version:  4.2.1
 Severity:  normal                         |   Keywords:
  Focuses:  accessibility, administration  |
-------------------------------------------+-----------------------------
 One of my more popular installs is getting its `debug.log` blasted with
 notices:


 {{{
 PHP Notice:  Undefined index: HTTP_HOST in /wp-includes/canonical.php on
 line 63
 }}}


 Which is in this conditional block of `redirect_canonical`


 {{{
 if ( !$requested_url ) {
         // build the URL in the address bar
         $requested_url  = is_ssl() ? 'https://' : 'http://';
         $requested_url .= $_SERVER['HTTP_HOST'];
         $requested_url .= $_SERVER['REQUEST_URI'];
 }
 }}}

 This is more than likely being generated by bots hitting pages that no
 longer exist or have never existed. I created a
 [https://wordpress.org/support/topic/undefined-index-http_host-canonical-
 nav-menu-template support topic] on the issue which then was told to
 create a ticket. I believe my 2nd notice ( in the support question ) is
 also related.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32229>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list