Title: Undefined index: HTTP_HOST
Last modified: June 23, 2021

---

# Undefined index: HTTP_HOST

 *  Resolved [mzwygart](https://wordpress.org/support/users/mzwygart/)
 * (@mzwygart)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/undefined-index-http_host-9/)
 * Hi,
 * When I use WP-CLI, I have this error:
    `Notice: Undefined index: HTTP_HOST in
   C:\path\to\my\site\web\app\plugins\wpcf7-redirect\classes\class-wpcf7r-updates.
   php on line 40`
 * I fixed it by replacing line 40 with
    `$this->domain = isset($_SERVER['HTTP_HOST'])?
   $_SERVER['HTTP_HOST'] : (string)parse_url(get_option('siteurl'), PHP_URL_HOST);`

Viewing 1 replies (of 1 total)

 *  [Qube One ltd](https://wordpress.org/support/users/querysolutions/)
 * (@querysolutions)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/undefined-index-http_host-9/#post-14695928)
 * thank you for the info
    this will be fixed on our next release

Viewing 1 replies (of 1 total)

The topic ‘Undefined index: HTTP_HOST’ is closed to new replies.

 * ![](https://ps.w.org/wpcf7-redirect/assets/icon-256x256.gif?rev=3416723)
 * [Redirection for Contact Form 7](https://wordpress.org/plugins/wpcf7-redirect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpcf7-redirect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpcf7-redirect/)
 * [Active Topics](https://wordpress.org/support/plugin/wpcf7-redirect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpcf7-redirect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpcf7-redirect/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Qube One ltd](https://wordpress.org/support/users/querysolutions/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/undefined-index-http_host-9/#post-14695928)
 * Status: resolved