I have good news for all those who're trying to set-up a multi-site drupal configuration and face head-aches with table prefixes so as to differentiate content. I successfully configured a multi-site drupal installation with one code base, one database (all tables shared) and each site showing different theme/blocks and different content on its front page.
This requires the following modules:
- views
- taxonomy
- taxnonomy_hide
First you install a standard version of drupal and the modules listed above. I tested this on drupal 5 but I guess it also works on drupal 4.7.x. For drupal 5, the taxonomy_hide module is not officially supported but you will find some builds ported to 5 in these forums. Don't forget to enable the modules through the Administration/Modules page.
Now you need to create a taxonomy vocabulary called something like "Sites" then add terms corresponding to the names of your sites. This is done in the Administration/Categories section.
If you don't want this vocabulary to be visible for the end user, you need to hide it using the taxonomy_hide module. Its settings are available through the Administration/Settings/Taxonomy_hide page.
Now jump to the Administration/Views section and find the "frontpage" view and click on the "add" link. It will create a new view with the same characteristics as the front page view. You need create one frontpage view for each of your sites. The differentiation is made through the Filters section. Choose the "Taxonomy Term" criteria and click "add". Now select the category you created for the site and save the new view. Repeat these steps for all the sites.
Now you need to differentiate each site's look and the blocks. Fortunately on drupal, the blocks settings are linked to the theme. That means that you can just assign theme to each site and it will have its own blocks settings while the sites will share all the blocks.
To finish, you need to create the sites' settings files in the /sites folder. Just duplicate the default folder and rename it with the domain name of each site. Open the settings file and go at the end where you'll find the $conf array. This array is composed of variables that you can force for each domain. What you need to force are the following variables:
site_name, theme_default, site_frontpage. The theme_default variable is the name of the theme you assigned to your site and the site_frontpage is the name of the view you created for the site.
Now when you create a node, you can decide on which site it is published by assigning it one or more terms of the "Sites" vocabulary you initially created. It means that the same node can appear in many site's front pages if you chose to make the selection multiple when you created the vocabulary.
The only drawback of this method for multiple sites is that virtually all the content is shared with all the sites. It means that if your visitor modifies the domain name on the URL of your node to another domain present in your /sites folder the node will still be displayed. Also when you use the search feature, it searches on all the sites, unless you hack it so as it searches only in a specific view or term.
However, this method is very easy to use and is not likely to generate unexpected behavior on drupal upgrade or with certain modules as it is the case with configurations based on database table prefixing. So it's perfect when you run a network of sites that have similar content and sometimes share the same content.
There are other possibilities if you want to control the access of the content through each domain, not allowing a node to be displayed on other sites than the one it was published on. One of them is the use of the Taxonomy Access Control (TAC) Module instead of views and prefix TAC tables so as to control what's accessed from where.
Good luck!