Drupal get base url. Here is an excerpt from its project page: .