drupal 8 base_url settings.php code example Example: drupal 8 get site base url $host = \Drupal::request()->getSchemeAndHttpHost();