Is this possible to use same database for two different domain? Example domain1.com and domain2.com but their views and designing are different for both site but content will be same .

If I change in one domain1.com it will reflect also in the domain2.com


You can using the Domain Access module.

The Domain Access project is a suite of modules that provide tools for running a group of affiliated sites from one Drupal installation and a single shared database. The module allows you to share users, content, and configurations across a group of sites such as:

example.com one.example.com two.example.com my.example.com thisexample.com <-- can use any domain string example.com:3000 <-- treats non-standard ports as unique By default, these sites share all tables in your Drupal installation.

  • it will work on the localhost? I have to install drupal for both domain ? can I use the different theme for both domain with same users , content and configration? – Manmeet Khurana Jul 6 '18 at 13:09
  • @ManmeetKhurana 1) Never tried it myself on localhost, but in theory it should work. 2) No you just install Drupal once 3) Yes diff theme for each site and configuration. An example of this is https://mahindrausa.com/ & https://build.mahindrausa.com/ & https://mahindracanada.ca/ – No Sssweat Jul 6 '18 at 22:51
  • I have done new installation on root directory for xyz.com .its working fine and now i have install the domain module and created the subdomain xyz.com.au and its directory under the root folder and fill both domain at domain setting xyz.com and xyz.com.au .but its not working for second domain . Have i miss something? – Manmeet Khurana Jul 11 '18 at 9:52
  • Please suggest how can use different domain for Domain Access Module not the sub domain. – Manmeet Khurana Jul 17 '18 at 6:54
  • @ManmeetKhurana Sorry I can't answer this with few words. You will need to read & follow the module's documentation. – No Sssweat Jul 17 '18 at 7:52

You should start from https://www.drupal.org/docs/8/multisite Drupal supports multisite structure out of the box. You don't need Domain Access module to reach it. You may share some db tables among your websites, e. g. content but keep settings (Views, display settings unique). It depends of your purpose. Also you may have shared or unique modules and themes. The idea is that you specify the list of the sites in sites.php and have several subfulders under /sites folder. At least it worked with Drupal 7. I'm sure there is no drastic charge with Drupal 8. But be careful with cache. Mind which caches you want to keep shared or unique.

  • i have setup two sites , can we separate both sites view like site1.com view show only in site1.com admin panel and vice versa? – Manmeet Khurana Jul 5 '18 at 9:26
  • You have to make Views settings (db tables storing such data) unique for every site. That means you will have all the Views separated. – Nikolay Volodin Jul 5 '18 at 9:45
  • can you suggest me any tutorial regarding the views setting for all setting only content will be the same? – Manmeet Khurana Jul 5 '18 at 9:55
  • Unfortunately, I don't have my laptop on tap with all the bookmarks at the moment. I did it quite a long time ago with Drupal 7. I don't recall any straight forward guide, just find some tutorial related to Multisite with Drupal 8, try it out, understand how it works and play around with the tables – Nikolay Volodin Jul 5 '18 at 10:03
  • I have setup the multi site with same database . How can I use different menu and footer for the different theme. I don't understand how can I use because using the same admin panel in multi site .I want different logo different footer different menu – Manmeet Khurana Jul 6 '18 at 8:01

If I understand you want to change only the theme based on the domain. I have not made such changes in Drupal 8 but Switch Page Theme module can help you.

Here is a similar question: How can I change the active theme programmatically?

  • yes I want to change the theme one theme for first domain and second theme for the second domain . Is their any method to setup with sub directory ?two setup of drupal with same database – Manmeet Khurana Jul 5 '18 at 7:40
  • If only the topic should be changed, it will be one drupal with two themes. There is no need to install two drupali. – quex Jul 5 '18 at 7:45
  • I understand what you are saying but I want different admin panel for both domain. – Manmeet Khurana Jul 5 '18 at 7:48
  • 1
    That makes no sense. The same content but different admin panels is a contradiction. If you want to have the same content on both pages, the content in admin will be same too. – Hudri Jul 5 '18 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.