<p>Yes it is possible. I have it done on a site which has some sub sites with different domain name. </p>

<p>You set your multi-environment configs for each site/subsite. </p>

<p>Then based on the domain the site is accessed by include different header/footer files. Then the main content/templates are mostly the same. 
Can share news between the sites so works well. 
I have a different structure controlling the main nav for each site. </p>

CC BY-SA 3.0
2015-12-11T23:44:50.877Z
So in order to do that do you need Craft Pro?

And do you do it with multi-environment config with 2 public folders, etc?
Dimitrios Vogiatzis
CC BY-SA 3.0
2015-12-11T23:53:07.440Z
Not necessarily. I did on the site I had as needed users functionality and back then needed Pro for the structures but everything mentioned above possible with lesser versions. Structures now included on the free version for personal sites.
mmc501
CC BY-SA 3.0
2015-12-13T10:53:09.587Z
Can you be a bit more specific how you accomplished this?
Dimitrios Vogiatzis
CC BY-SA 3.0
2015-12-13T11:06:10.503Z
What part? In my general config file have the setting for each domain and I sera variable, e.g. siteid. Then in template files, eg main layout one I have a switch statement based on the siteid variable to pull in different header and footer files. The different header files get their main nav from different structures. Then say for a news section you can use the same main body templates if necessary.
mmc501
CC BY-SA 3.0
2015-12-13T11:13:14.493Z
Here is a question I had asked before doing it: http://craftcms.stackexchange.com/q/9763/622
mmc501
CC BY-SA 3.0
2015-12-11T21:27:44.003Z
2015-12-11T21:27:44.003Z
mmc501
<p>Multi-environment-configs: don't think so.</p>

<p>Maybe a solution is to use json template files on website1.com that you read (without craft) on website2.com?</p>

CC BY-SA 3.0
2016-03-10T21:22:09.493Z
The idea is to have two websites with two different domains and one install.

The main reason is because the 2 websites share the same content so it's pointless to have the same content input twice.
Dimitrios Vogiatzis
CC BY-SA 3.0
2015-12-11T21:09:21.010Z
2015-12-11T21:09:21.010Z
Dave Driesmans
<p>I'm trying to build a website for a client that has actually two websites for different locations and we need to merge both of them in a new one. </p>

<p>The only thing is that he wants to keep the domains separate, which means that when you visit website1.com you will see templates for that website and the url address will display website1.com/.../ etc. And when you visit website2.com while you browse the site you will retain this url. </p>

<p>Is this possible with Craft? Because we will have one database and install but 2 domains with one parked over the other. Can this be done with the Multi-environment technique described here? </p>

<p><a href="https://craftcms.com/docs/multi-environment-configs" rel="nofollow">https://craftcms.com/docs/multi-environment-configs</a></p>

<multi-domain>
Two domains with two different templates
# Two domains with two different templates

(Asked by: username_0 on 2015-12-11)

I'm trying to build a website for a client that has actually two websites for different locations and we need to merge both of them in a new one.

The only thing is that he wants to keep the domains separate, which means that when you visit website1.com you will see templates for that website and the url address will display website1.com/.../ etc. And when you visit website2.com while you browse the site you will retain this url.

Is this possible with Craft? Because we will have one database and install but 2 domains with one parked over the other. Can this be done with the Multi-environment technique described here?

<https://craftcms.com/docs/multi-environment-configs>

**Tags:** multi-domain


---

## 2 answers

### Answer by username_1 on 2015-12-11. Score: 1 | Accepted answer

Yes it is possible. I have it done on a site which has some sub sites with different domain name.

You set your multi-environment configs for each site/subsite.

Then based on the domain the site is accessed by include different header/footer files. Then the main content/templates are mostly the same.
Can share news between the sites so works well.
I have a different structure controlling the main nav for each site.

> **Comments:**
> **username_0**: So in order to do that do you need Craft Pro?  And do you do it with multi-environment config with 2 public folders, etc?  
> **username_1**: Not necessarily. I did on the site I had as needed users functionality and back then needed Pro for the structures but everything mentioned above possible with lesser versions. Structures now included on the free version for personal sites.  
> **username_0**: Can you be a bit more specific how you accomplished this?  
> **username_1**: What part? In my general config file have the setting for each domain and I sera variable, e.g. siteid. Then in template files, eg main layout one I have a switch statement based on the siteid variable to pull in different header and footer files. The different header files get their main nav from different structures. Then say for a news section you can use the same main body templates if necessary.  
> **username_1**: Here is a question I had asked before doing it: http://craftcms.stackexchange.com/q/9763/622  

---

### Answer by username_2 on 2015-12-11. Score: 1

Multi-environment-configs: don't think so.

Maybe a solution is to use json template files on website1.com that you read (without craft) on website2.com?

> **Comments:**
> **username_0**: The idea is to have two websites with two different domains and one install.  The main reason is because the 2 websites share the same content so it's pointless to have the same content input twice.  

---

