diff --git a/boost.admin.inc b/boost.admin.inc
index 0184069..875db3a 100644
--- a/boost.admin.inc
+++ b/boost.admin.inc
@@ -411,6 +411,12 @@ function boost_admin_boost_performance_page() {
     '#default_value' => BOOST_MULTISITE_SINGLE_DB,
     '#description'   => t('Enabling will allow for correct multi-site caching, in cases where different content is served from the same Drupal installation, based on domain. Examples: Multi-site with a single/shared database, site translation detection based on domain, and the contributed "Domain Access" module.'),
   );
+  $form['directories']['boost_determine_host_from_http'] = array(
+    '#type'          => 'checkbox',
+    '#title'         => t('Determine host from HTTP request, not $base_url'),
+    '#default_value' => BOOST_DETERMINE_HOST_FROM_HTTP,
+    '#description'   => t('Enabling will have Boost look to the original HTTP request to determine the domain - Enable if you are using multiple domains or subdomains but have set $base_url in settings.php.'),
+  );
   if (!BOOST_MULTISITE_SINGLE_DB) {
 //     $form['directories']['boost_host'] = array(
 //       '#type'          => 'textfield',
diff --git a/boost.module b/boost.module
index 626a63c..16bb4c1 100644
--- a/boost.module
+++ b/boost.module
@@ -42,6 +42,7 @@ define('BOOST_VIEWS_LIST_BEHAVIOR',  variable_get('boost_views_list_behavior', 0
 // Dir & File Structure
 define('BOOST_ROOT_CACHE_DIR',       variable_get('boost_root_cache_dir', 'cache'));
 define('BOOST_MULTISITE_SINGLE_DB',  variable_get('boost_multisite_single_db', TRUE));
+define('BOOST_DETERMINE_HOST_FROM_HTTP',  variable_get('boost_determine_host_from_http', FALSE));
 define('BOOST_NORMAL_DIR',           variable_get('boost_normal_dir', 'normal'));
 define('BOOST_GZIP_DIR',             variable_get('boost_gzip_dir', 'normal'));
 define('BOOST_PERM_NORMAL_DIR',      variable_get('boost_perm_normal_dir', 'perm'));
@@ -4498,7 +4499,12 @@ function boost_cache_directory($host = NULL, $absolute = TRUE, $root_dir = NULL,
   }
 
   $parts = parse_url($temp_base_url);
-  $host = !empty($host) ? $host : $parts['host'];
+  if (BOOST_DETERMINE_HOST_FROM_HTTP) {
+    $host = $_SERVER['HTTP_HOST'];
+  }
+  else {
+    $host = !empty($host) ? $host : $parts['host'];
+  }
   $host = strtolower($host);
   $parts['path'] = isset($parts['path']) ? $parts['path'] : '/';
   $subdir = implode('/', array_filter(explode('/', (!empty($base_path)) ? $base_path : $parts['path'])));
