Here is just another typical one:
The customer needs two kinds of presentations of the same content, and such presentations should be decided by different URL.
More concretely, assumed that we have a domain named "http://www.example.com". This is the main site used for some people. At the same time, "http://www.example.com/show/" will be used for some other purpose, e.g. as a content provider with different front page.
Let's do it step by step:
- Find the configuration file httpd.conf of your Apache server. Add the following line at the end of the file.
It maps the path to your drupal installation directory.Alias /show "C:/Programme/xampp/htdocs/drupal/" #<- The path to your drupal directory. It can be "/var/www/htdocs/" on a linux server or alike.
- Go to the /sites directory under the drupal installation directory. Copy the /default directory to a new directory with all the containing files. The new directory can be called "/www.example.com.show" or "/localhost.show". It depends on where you install your drupal.
- Make changes to the settings.php in the new directory.
- Since we use the same database and don't want to create new tables, we use:
$db_url = 'mysql://name:password@localhost/drupal';
$db_prefix = ''; - For the URL we use, change the base URL:
$base_url = 'http://localhost/show'; // NO trailing slash!
- Something we want to change is the theme and front page, etc. It can be achieved by:
$conf = array(
'site_name' => 'My Drupal site',
'theme_default' => 'pushbutton',
'anonymous' => 'Visitor',
); - To get clean URL's with multi-site I added the following to the .htaccess file
# rewrite commands for drupal dev sites
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/show/.*
RewriteRule ^(.*)$ /show/index.php?q=$1 [L,QSA] - restart the Apache server and go to the URL "http://www.example.com/show/" to see what happens.