Base url issues and subdirectories
There are two things you can do here in order to try and make you site more portable.

In your templates:


Always use l() for all links (even JavaScript links)
If you need to reference an image in the theme use: 

&lt;img src="&lt;?php echo $base_path . drupal_get_path('theme', 'themename'); ?&gt;/logo.png" /&gt;



In your content:


You do not really have a way in order to preserve uploaded content URL's unless using some form of file manager which do not create absolute links, but much rather links that get sent to drupal that redirect to the file
If the above is not going to work for you then a modification of the rewrite rules for the drupal site sitting under the subdir is required to basically rewrite all URLs requested that start with sites/default/files/(.*) rewritten to subdir/sites/default/files/$1


And the apache mod_rewrite rule may look like the following.

# Redirect all files requests to a subdir
RewriteRule ^/?sites/default/files/(.*) /subdir/sites/default/files/$1 [R=301,L]