0

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

1

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.

| improve this answer | |
  • 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 Dec 11 '15 at 23:44
  • 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 Dec 11 '15 at 23:53
  • Can you be a bit more specific how you accomplished this? – Dimitrios Vogiatzis Dec 13 '15 at 10:53
  • 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 Dec 13 '15 at 11:06
  • Here is a question I had asked before doing it: craftcms.stackexchange.com/q/9763/622 – mmc501 Dec 13 '15 at 11:13
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?

| improve this answer | |
  • 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 Mar 10 '16 at 21:22

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.