<p><strong>Multisite is coming to Craft 3, so this only applies to v2 <a href="https://craftcms.com/news/craft-3-multi-site" rel="nofollow noreferrer">See here</a></strong></p>

<hr>

<p>I don't think there is an integrated way to do this and it might be worth reading this post:</p>

<p><a href="https://craftcms.stackexchange.com/questions/408/are-there-any-intentions-to-release-multisite-support-for-craft">Are there any intentions to release multisite support for Craft?</a></p>

<blockquote>
  <p>..we're pretty against adding it to Craft... at least in the way EE did it, where everything is stored on a per-site basis.</p>
</blockquote>

<p>That said, I guess you could do this with symbolic links if you wanted, this is untested but in theory it should/could work...</p>

<p>Say you have these folders on your website:</p>

<ul>
<li>craftinstall

<ul>
<li>craft</li>
<li>public</li>
</ul></li>
<li>product</li>
<li>brand</li>
</ul>

<p>You could do <code>ln -s /path/to/craftinstall/public /path/to/product/public</code> and then repeat that for the brand, this will then mean both the <code>public</code> folders for your websites will point to the <code>craftinstall/public</code> folder and should then be able to pick up the <code>craft</code> folder.</p>

<p>In your <code>general.php</code> config file you could have these settings:</p>

<pre><code> // Fetch url scheme
define('URI_SCHEME', ( isset($_SERVER['HTTPS'] ) ) ? "https://" : "http://" );

// Fetch current environment url
define('SITE_URL', URI_SCHEME . $_SERVER['SERVER_NAME'] . '/');


define('BASEPATH', realpath(CRAFT_BASE_PATH . '/../') . '/');

return array(

  // These are common (default) to all
 '*' =&gt; array(
   'environmentVariables' =&gt; array(
      'basePath' =&gt; BASEPATH,
      'siteUrl'  =&gt; SITE_URL
   )
 );
</code></pre>

<p>This would mean that whatever the url is, i.e: <code>www.brand.com</code> will be set as the siteUrl so in your actual craft install, under general settings your site url will simply be <code>{siteUrl}</code> and this will get replaced (same with <code>basePath</code>)</p>

<p>Which would then mean both sites should then point to the same craft install, now for templates and routes, this might not work, but it might but you <em>could</em> do something like this:</p>

<p>Your templates folder structure:</p>

<ul>
<li>templates

<ul>
<li>brand.com

<ul>
<li>brand-news</li>
</ul></li>
<li>product.com

<ul>
<li>product-news</li>
</ul></li>
</ul></li>
</ul>

<p>And in <code>public/index.php</code> file something like:</p>

<pre><code>define('CRAFT_TEMPLATES_PATH', "craft/templates/" . $_SERVER['SERVER_NAME']);
</code></pre>

<p>As I said, I haven't tried or tested this so it would be interesting if it did work, this is just my theory :)</p>

CC BY-SA 3.0
2016-02-19T10:07:59.583Z
ok, i'll try it out and let you know. thanks a lot alec!
Dave Driesmans
CC BY-SA 3.0
2017-06-15T03:28:27.040Z
This now changes with Craft 3. Perhaps you'd consider updating your answer?
Simon East
CC BY-SA 3.0
2016-02-18T10:01:13.170Z
2017-08-11T16:17:02.000Z
2017-08-11T16:17:02.000Z
Alec Ritson
<p>Completely untested, but you may consider setting up each site as environment using <a href="https://craftcms.com/docs/multi-environment-configs" rel="nofollow">Multi-Environment Config</a> approach. </p>

<p>Then in each domain's site root directory you'll need to place <code>.htaccess</code> and <code>index.php</code> like this is done for <a href="https://craftcms.com/docs/localization-guide#step-5-set-up-the-files" rel="nofollow">Localized Sites</a></p>

<p>Then you can configure URLs for each site pages in <code>routes.php</code> config file (so you can use different templates for different sites). </p>

<p>This is of course not as flexible as MSM in EE, but you'll have the 2 sites in one control panel and save on license cost.</p>

CC BY-SA 3.0
2016-02-19T19:59:19.350Z
2016-02-19T19:59:19.350Z
Yuri Salimovskiy
<p>I have two small sites finished at front-end stage that are closely related. One is the product, one the brand. The two sites use the same css and js files and are mostly static pages in three languages. 
The clients (and me) would like to do this under one craft set up</p>

<p>What do i have to do to keep (without a redirect)</p>

<pre><code>www.product.com     (with eg www.product.com/nl/product-news)
www.brand.com       (with eg www.brand.com/nl/brand-news)
</code></pre>

<p>with only one admin and one template and public directory?</p>

CC BY-SA 3.0
2016-06-03T11:14:53.993Z
Did you try any of the answers given? We're having this issue now, and would like to know if there's a good work-around for it.
peirix
CC BY-SA 3.0
2016-06-03T12:42:48.640Z
in the end i worked with a basic php files that reads json for the content. cms, css, js and assets where centralised in one domain.
Dave Driesmans
<setup>
Multisite: how to?
# Multisite: how to?

(Asked by: username_0 on 2016-02-17)

I have two small sites finished at front-end stage that are closely related. One is the product, one the brand. The two sites use the same css and js files and are mostly static pages in three languages. 
The clients (and me) would like to do this under one craft set up
What do i have to do to keep (without a redirect)
www.product.com     (with eg www.product.com/nl/product-news)
www.brand.com       (with eg www.brand.com/nl/brand-news)

with only one admin and one template and public directory?

**Tags:** setup
> **Comments:**
> **username_1**: Did you try any of the answers given? We're having this issue now, and would like to know if there's a good work-around for it.  
> **username_0**: in the end i worked with a basic php files that reads json for the content. cms, css, js and assets where centralised in one domain.  

---

## 2 answers

### Answer by username_2 on 2016-02-18. Score: 3

Multisite is coming to Craft 3, so this only applies to v2 See here

I don't think there is an integrated way to do this and it might be worth reading this post:
Are there any intentions to release multisite support for Craft?

..we're pretty against adding it to Craft... at least in the way EE did it, where everything is stored on a per-site basis.

That said, I guess you could do this with symbolic links if you wanted, this is untested but in theory it should/could work...
Say you have these folders on your website:

craftinstall


craft
public

product
brand

You could do ln -s /path/to/craftinstall/public /path/to/product/public and then repeat that for the brand, this will then mean both the public folders for your websites will point to the craftinstall/public folder and should then be able to pick up the craft folder.
In your general.php config file you could have these settings:
 // Fetch url scheme
define('URI_SCHEME', ( isset($_SERVER['HTTPS'] ) ) ? "https://" : "http://" );

// Fetch current environment url
define('SITE_URL', URI_SCHEME . $_SERVER['SERVER_NAME'] . '/');


define('BASEPATH', realpath(CRAFT_BASE_PATH . '/../') . '/');

return array(

  // These are common (default) to all
 '*' => array(
   'environmentVariables' => array(
      'basePath' => BASEPATH,
      'siteUrl'  => SITE_URL
   )
 );

This would mean that whatever the url is, i.e: www.brand.com will be set as the siteUrl so in your actual craft install, under general settings your site url will simply be {siteUrl} and this will get replaced (same with basePath)
Which would then mean both sites should then point to the same craft install, now for templates and routes, this might not work, but it might but you could do something like this:
Your templates folder structure:

templates


brand.com


brand-news

product.com


product-news



And in public/index.php file something like:
define('CRAFT_TEMPLATES_PATH', "craft/templates/" . $_SERVER['SERVER_NAME']);

As I said, I haven't tried or tested this so it would be interesting if it did work, this is just my theory :)

> **Comments:**
> **username_0**: ok, i'll try it out and let you know. thanks a lot alec!  
> **username_3**: This now changes with Craft 3. Perhaps you'd consider updating your answer?  

---

### Answer by username_4 on 2016-02-19. Score: 2

Completely untested, but you may consider setting up each site as environment using [Multi-Environment Config](https://craftcms.com/docs/multi-environment-configs) approach.

Then in each domain's site root directory you'll need to place `.htaccess` and `index.php` like this is done for [Localized Sites](https://craftcms.com/docs/localization-guide#step-5-set-up-the-files)

Then you can configure URLs for each site pages in `routes.php` config file (so you can use different templates for different sites).

This is of course not as flexible as MSM in EE, but you'll have the 2 sites in one control panel and save on license cost.


---

