Tuesday, January 29, 2019

How to create a subsite in Drupal


  1. Create a subdirectory inside sites folder of your Drupal installation, it will be inside docroot folder.
    Drupal-Multisite Directory Structure
  2. Create a virtual host. You can follow any of the steps from traditional way to executing a bash script. I recommend executing a bash script so that you don't need to go through all steps everytime.
  3. Make a copy of /docroot/sites/example.sites.php called /docroot/sites/sites.php
  4. Add the below line of code inside the sites.php.
    $sites['sub-site-address.domain'] = 'subsite';
  5. Check the newly created subsite from your browser 'sub-site-address.domain' and install the site.
  6. Create folders for modules, themes, libraries etc., and add your custom theme or module specific to this newly created site if you wish.

No comments:

Post a Comment