--- includes/common.inc.orig	2005-01-17 13:11:36.000000000 +0100
+++ includes/common.inc	2005-01-18 08:08:49.000000000 +0100
@@ -55,11 +55,10 @@ function drupal_set_html_head($data = NU
  * Retrieve output to be displayed in the head tag of the HTML page.
  */
 function drupal_get_html_head() {
-  global $base_url;
+  global $base_url_path;
 
   $output = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
-  $output .= "<base href=\"$base_url/\" />\n";
-  $output .= theme('stylesheet_import', 'misc/drupal.css');
+  $output .= theme('stylesheet_import', $base_url_path. 'misc/drupal.css');
 
   return $output . drupal_set_html_head();
 }
@@ -1402,7 +1401,7 @@ function form_weight($title = NULL, $nam
  * alternative than url().
  */
 function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE) {
-  global $base_url;
+  global $base_url, $base_url_path;
 
   static $script;
 
@@ -1419,7 +1418,7 @@ function url($path = NULL, $query = NULL
     $fragment = '#'. $fragment;
   }
 
-  $base = ($absolute ? $base_url . '/' : '');
+  $base = ($absolute ? $base_url . '/' : $base_url_path);
 
   if (variable_get('clean_url', '0') == '0') {
     if (isset($path)) {
--- includes/bootstrap.inc.1	2005-01-18 08:11:58.000000000 +0100
+++ includes/bootstrap.inc	2005-01-18 08:08:15.000000000 +0100
@@ -638,5 +638,6 @@ function drupal_get_messages() {
 
 // Initialize configuration variables, using values from conf.php if available.
 $conf = variable_init(isset($conf) ? $conf : array());
-
+$parts = parse_url($base_url);
+$base_url_path = (isset($parts['path']) ? $parts['path'] . '/' : '/');
 ?>
--- includes/theme.inc.1	2005-01-17 13:46:19.000000000 +0100
+++ includes/theme.inc	2005-01-18 08:10:08.000000000 +0100
@@ -33,7 +33,7 @@ function theme_help($section) {
  *   The name of the currently selected theme.
  */
 function init_theme() {
-  global $user, $custom_theme, $theme_engine, $theme_key;
+  global $user, $custom_theme, $theme_engine, $theme_key, $base_url_path;
 
   $themes = list_themes();
 
@@ -62,7 +62,7 @@ function init_theme() {
     // File is a template/theme
     // Load its CSS, if it exists
     if (file_exists($stylesheet = dirname($themes[$theme]->filename) .'/style.css')) {
-      theme_add_style($stylesheet);
+      theme_add_style($base_url_path . $stylesheet);
     }
   }
 
@@ -258,7 +258,7 @@ function theme_get_settings($key = NULL)
  *   The value of the requested setting, NULL if the setting does not exist.
  */
 function theme_get_setting($setting_name, $refresh = FALSE) {
-  global $theme_key;
+  global $theme_key, $base_url_path;
   static $settings;
 
   if (empty($settings) || $refresh) {
@@ -276,11 +276,12 @@ function theme_get_setting($setting_name
     }
 
     if ($settings['toggle_logo']) {
+      $settings['logo'] = $base_url_path;
       if ($settings['default_logo']) {
-        $settings['logo'] = dirname($theme_object->filename) .'/logo.png';
+        $settings['logo'] .= dirname($theme_object->filename) .'/logo.png';
       }
       elseif ($settings['logo_path']) {
-        $settings['logo'] = $settings['logo_path'];
+        $settings['logo'] .= $settings['logo_path'];
       }
     }
 
@@ -439,8 +440,10 @@ function theme_links($links, $delimiter 
  *   A string containing the image tag.
  */
 function theme_image($path, $alt = '', $title = '', $attr = '', $getsize = true) {
+  global $base_url_path;
+
   if (!$getsize || (file_exists($path) && (list($width, $height, $type, $attr) = @getimagesize($path)))) {
-    return "<img src=\"$path\" $attr alt=\"$alt\" title=\"$title\" />";
+    return "<img src=\"$base_url_path$path\" $attr alt=\"$alt\" title=\"$title\" />";
   }
 }
 
--- themes/engines/xtemplate/xtemplate.engine.1	2005-01-17 13:47:06.000000000 +0100
+++ themes/engines/xtemplate/xtemplate.engine	2005-01-18 08:10:38.000000000 +0100
@@ -112,7 +112,9 @@ function xtemplate_comment($comment, $li
 }
 
 function xtemplate_page($content) {
-  global $xtemplate;
+  global $xtemplate, $base_url_path;
+
+  $xtemplate->template->assign('base_url_path', $base_url_path);
 
   $xtemplate->template->assign(array(
     "language" => $GLOBALS['locale'],
--- themes/bluemarine/xtemplate.xtmpl.1	2005-01-17 13:51:48.000000000 +0100
+++ themes/bluemarine/xtemplate.xtmpl	2005-01-18 08:11:06.000000000 +0100
@@ -15,11 +15,11 @@
     <td id="logo">
 
       <!-- BEGIN: logo -->
-        <a href="./" title="Home"><img src="{logo}" alt="Home" /></a>
+        <a href="{base_url_path}" title="Home"><img src="{logo}" alt="Home" /></a>
       <!-- END: logo -->
 
       <!-- BEGIN: site_name -->
-        <h1 class='site-name'><a href="./" title="Home">{site_name}</a></h1>
+        <h1 class='site-name'><a href="{base_url_path}" title="Home">{site_name}</a></h1>
       <!-- END: site_name -->
 
       <!-- BEGIN: site_slogan -->
