Answers.Body: <p>The <code>isSystemLive</code> config setting isn't multi-site aware. It sets the entire Craft installation on or off, rather than per site, so you'll need to find a different method to disable <code>domain2.com</code> on the production server.</p>
  
  <p>Untested, but you could try to set the <code>baseUrl</code> for <code>domain2.com</code> to an empty string on production and see if that works.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-05T13:35:21.147Z
Answers.Text: Just discovered this while submitting a Feature request. https://github.com/craftcms/cms/issues/3005  Thanks!
Answers.UserDisplayName: foamcow
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-05T13:36:50.943Z
Answers.Text: For the record, I turned off "This site has a base url" and set the site url to a blank string as suggested. Not sure
Answers.UserDisplayName: foamcow
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-05T13:27:14.580Z
Answers.LastActivityDate: 2019-06-05T13:27:14.580Z
Answers.UserDisplayName: Steve Rowling
Answers.Body: <p>If you are running Apache, you could set your <code>ENVIRONMENT</code> variable in your <code>&lt;VirtualHost&gt;</code> directive using <code>SetEnv ENVIRONMENT "domain2"</code> then have a section:</p>
  
  <pre class="lang-php prettyprint-override"><code>'domain2' =&gt; [
     'isSystemLive' =&gt; false
  ],
  </code></pre>
  
  <p>In your <code>config/general.php</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-05T12:40:05.867Z
Answers.LastActivityDate: 2019-06-05T12:40:05.867Z
Answers.UserDisplayName: Oli
Body: <p>Given a multi site setup (domain1.com, domain2.com) that also uses multiple environments (dev, staging, production) - how would one configure one of the sites to be turned off in the production environment?</p>
  
  <p>I'm currently trying the following.</p>
  
  <pre><code>return [
      // Global settings
      '*' =&gt; [
          // removed for clarity
      ],
  
  
      'dev' =&gt; [
          'devMode' =&gt; true,
          'isSystemLive' =&gt; [
              'domain1.com' =&gt; true,
              'domain2.com' =&gt; false
          ]
      ],
  
      // Staging environment settings
      'staging' =&gt; [
          'devMode' =&gt; true,
          'isSystemLive' =&gt; [
              'domain1.com' =&gt; true,
              'domain2.com' =&gt; false
          ]
      ],
  
      // Production environment settings
      'production' =&gt; [
          'devMode' =&gt; false,
          'isSystemLive' =&gt; [
              'domain1.com' =&gt; true,
              'domain2.com' =&gt; false
          ]
      ]
  ];
  </code></pre>
  
  <p>Which I would have expected to have domain2.com turned off but domain1.com remains on. However, both sites are on.</p>
  
  <p>I have also tried rearranging the config using the following structure (stripped back for brevity) </p>
  
  <pre><code>return [
      'domain1.com' =&gt; [
          '*' =&gt; [
              // default for domain1
          ],
  
          'dev' =&gt; [
              'isSystemLive' =&gt; true
          ],
  
          'staging' =&gt; [
              'isSystemLive' =&gt; true
          ],
  
          'production' =&gt; [
              'isSystemLive' =&gt; true
          ]
      ],
  
      'domain2.com' =&gt; [
          '*' =&gt; [
              // default for domain2
          ],
  
          'dev' =&gt; [
              'isSystemLive' =&gt; false
          ],
  
          'staging' =&gt; [
              'isSystemLive' =&gt; false
          ],
  
          'production' =&gt; [
              'isSystemLive' =&gt; false
          ]
      ],
  ]
  </code></pre>
  
  <p>But this also doesn't work.</p>
  
  <p>So how should I specify different multi-environment configs for each site?</p>
  
Tags: <craft3><config><configuration>
Title: Turning off a site in multi-site/multi-environment config
ThreadText: # Turning off a site in multi-site/multi-environment config
  
  (Asked by: username_0 on 2019-06-05)
  
  Given a multi site setup (domain1.com, domain2.com) that also uses multiple environments (dev, staging, production) - how would one configure one of the sites to be turned off in the production environment?
  
  I'm currently trying the following.
  
  ```
  return [
      // Global settings
      '*' => [
          // removed for clarity
      ],
  
      'dev' => [
          'devMode' => true,
          'isSystemLive' => [
              'domain1.com' => true,
              'domain2.com' => false
          ]
      ],
  
      // Staging environment settings
      'staging' => [
          'devMode' => true,
          'isSystemLive' => [
              'domain1.com' => true,
              'domain2.com' => false
          ]
      ],
  
      // Production environment settings
      'production' => [
          'devMode' => false,
          'isSystemLive' => [
              'domain1.com' => true,
              'domain2.com' => false
          ]
      ]
  ];
  
  ```
  
  Which I would have expected to have domain2.com turned off but domain1.com remains on. However, both sites are on.
  
  I have also tried rearranging the config using the following structure (stripped back for brevity)
  
  ```
  return [
      'domain1.com' => [
          '*' => [
              // default for domain1
          ],
  
          'dev' => [
              'isSystemLive' => true
          ],
  
          'staging' => [
              'isSystemLive' => true
          ],
  
          'production' => [
              'isSystemLive' => true
          ]
      ],
  
      'domain2.com' => [
          '*' => [
              // default for domain2
          ],
  
          'dev' => [
              'isSystemLive' => false
          ],
  
          'staging' => [
              'isSystemLive' => false
          ],
  
          'production' => [
              'isSystemLive' => false
          ]
      ],
  ]
  
  ```
  
  But this also doesn't work.
  
  So how should I specify different multi-environment configs for each site?
  
  **Tags:** craft3, config, configuration
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-06-05. Score: 2 | Accepted answer
  
  The `isSystemLive` config setting isn't multi-site aware. It sets the entire Craft installation on or off, rather than per site, so you'll need to find a different method to disable `domain2.com` on the production server.
  
  Untested, but you could try to set the `baseUrl` for `domain2.com` to an empty string on production and see if that works.
  
  > **Comments:**
  > **username_0**: Just discovered this while submitting a Feature request. https://github.com/craftcms/cms/issues/3005  Thanks!  
  > **username_0**: For the record, I turned off "This site has a base url" and set the site url to a blank string as suggested. Not sure  
  
  ---
  
  ### Answer by username_2 on 2019-06-05. Score: 1
  
  If you are running Apache, you could set your `ENVIRONMENT` variable in your `<VirtualHost>` directive using `SetEnv ENVIRONMENT "domain2"` then have a section:
  
  ```php
  'domain2' => [
     'isSystemLive' => false
  ],
  
  ```
  
  In your `config/general.php`.
  
  
  ---
  
  