# \[Howto\] Individual themes per domain

**URL:** <https://help.nextcloud.com/t/howto-individual-themes-per-domain/27585>\
**Category:** 📑 How to\
**Tags:** theming\
**Created:** [February 15, 2018, 6:17pm UTC](https://help.nextcloud.com/t/howto-individual-themes-per-domain/27585 "2018-02-15T18:17:44Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![HeisenbergDo](https://help.nextcloud.com/letter_avatar/heisenbergdo/32/5_5575768a8748004e209b776fc1b2916d.png) [@HeisenbergDo](https://help.nextcloud.com/u/HeisenbergDo)\
**Post date:** [June 15, 2018, 4:56pm UTC](https://help.nextcloud.com/t/howto-individual-themes-per-domain/27585/6 "2018-06-15T16:56:02Z")

</div>

@RobiRob,

Its not tricky.

Add all Domains to $CONFIG[‘trusted\_domains’][]. You can do this with config/config.php or in the first lines in config/domains.config.php.

```
'trusted_domains' =>
    array (
        0 => 'cloud.domain1.com',
        1 => 'cloud.domain2.com',
        2 => 'cloud.domain3.com',
        3 => 'cloud.domain4.com',
),

```

In config/domains.config.php

```
# if not set in config/config.php
$CONFIG['trusted_domains'] = array (
    0 => 'cloud.domain1.com',
    1 => 'cloud.domain2.com',
    2 => 'cloud.domain3.com',
    3 => 'cloud.domain4.com',
);

if (isset($_SERVER['HTTP_HOST'])) {
    switch ($_SERVER['HTTP_HOST']) {
        # Server called with cloud.domain1.com
        case 'cloud.domain1.com':
            # sure, we can do more stuff like checking an existing
            # directory in the themes directory

            # use this theme (must exists in themes/ )
            $CONFIG['theme']='cloud.domain1.com';
            # configure local-part of email address
            $CONFIG['mail_from_address'] = 'no-reply';
            # configure domain of email address
            $CONFIG['mail_domain'] = 'domain1.com';
            break;
        case 'cloud.domain2.com':
            $CONFIG['theme']='cloud.domain2.com';
            $CONFIG['mail_from_address'] = 'no-reply';
            $CONFIG['mail_domain'] = 'domain2.com';
            break;
        # and so on for other domains
    }
}

```

The directory “themes/domain1.com” contains the following files:  
themes/domain1.com/defaults.php  
themes/domain1.com/core/apps/img/favicon-touch.png  
themes/domain1.com/core/css/server.css  
themes/domain1.com/core/img/favicon.ico  
themes/domain1.com/core/img/logo.svg  
themes/domain1.com/core/img/domain1.com-norm.svg  
themes/domain1.com/core/img/favicon-touch.png  
themes/domain1.com/core/img/domain1.com-logo.svg  
themes/domain1.com/core/img/favicon-64.png  
themes/domain1.com/core/img/favicon-16.png  
themes/domain1.com/core/img/domain1.com-logo-wide.svg  
themes/domain1.com/core/img/favicon-128.png  
themes/domain1.com/core/img/favicon-256.png  
themes/domain1.com/core/img/favicon-32.png  
themes/domain1.com/core/img/favicon.png

themes/domain1.com/defaults.php:

```
<?php
class OC_Theme {
    # for a list of functions see /lib/private/defaults.php
   function __construct() {
   }
   public function getTitle() {
       return "My Own Nextcloud";
   }
   public function getName() {
       return "Best-Cloud";
   }
   public function getHTMLName() {
       return "Best-Cloud";
   }
   public function getEntity() {
       // Footer-Name
       return "My Company";
   }
   public function getSlogan() {
       return "We do everything for you :-)";
   }
   public function getLongFooter() {
       return $this->getShortFooter();
   }
   public function getShortFooter() {
       return '<a href="https://domain1.com" target="_blank" rel="noreferrer">' . $this->getEntity() . '</a> - ' . $this->getSlogan();
   }
   public function getLogoClaim() {
       return '';
   }

```

}

---

_[View the full topic](https://help.nextcloud.com/t/howto-individual-themes-per-domain/27585)._
