drupal 8 get the current host address code example Example: drupal 8 get site base url $host = \Drupal::request()->getSchemeAndHttpHost();