diff --git a/includes/locale.inc b/includes/locale.inc
index c7f9583..45f409a 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -448,7 +448,9 @@ function locale_language_url_rewrite_url(&$path, &$options) {
           $host = parse_url($host, PHP_URL_HOST);
 
           // Apply the appropriate protocol to the URL.
-          $options['base_url'] = $url_scheme . $host;
+          global $base_path;
+          $trimmed_base_path = rtrim($base_path, '/');
+          $options['base_url'] = $url_scheme . $host . $trimmed_base_path;
           if (isset($options['https']) && variable_get('https', FALSE)) {
             if ($options['https'] === TRUE) {
               $options['base_url'] = str_replace('http://', 'https://', $options['base_url']);
