here is what I did in a similar case.
Let's say you have 2 websites with 2 store view each. both website have a EN and a DE store view (codes can be anything).
First create 2 folders in the root of your magento install with 2 subfolders each.
website1/de. Do the same for
website2 and its subfolders.
index.php from all the folders and subfolders like this:
$mageFilename = MAGENTO_ROOT . '/app/Mage.php'; with
$mageFilename = '../app/Mage.php'; and
Mage::run('website code here for each website', 'website');
Then in the
index.php of each of the
$mageFilename = MAGENTO_ROOT . '/app/Mage.php'; to
$mageFilename = '.././app/Mage.php';
Mage::run('each store view code here', 'store');
Now remove the
Show store codes in url flag.
System->Configuration->web->unsecure set the these values
Base Skin URL :
http://example.com/skin/ instead of
Base Media URL :
http://example.com/media/ instead of
http://example.com/js/ instead of
Do the same for the secure section if you are using secure urls just put
https instead of
Now you have to create 2 virtual hosts, one for each website.
The document root for the first website will be
website1 folder and for the second one
If you want you can create only one folder
website1 but this means that you have to create the
de folders in the root folder of your magento instance for the second website and your second website has to have the document root, the root of your magento instance.