# Multi-domain set-up in 1 modx cloud

**URL:** <https://community.modx.com/t/multi-domain-set-up-in-1-modx-cloud/5583>\
**Category:** Getting Started\
**Created:** [July 19, 2022, 11:38pm UTC](https://community.modx.com/t/multi-domain-set-up-in-1-modx-cloud/5583 "2022-07-19T23:38:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![werner-NL](https://community.modx.com/letter_avatar_proxy/v4/letter/w/aca169/32.png) [@werner-NL](https://community.modx.com/u/werner-NL)\
**Post date:** [July 19, 2022, 11:38pm UTC](https://community.modx.com/t/multi-domain-set-up-in-1-modx-cloud/5583/1 "2022-07-19T23:38:20Z")

</div>

Hi,

New modx cloud user. Have some experience (1 year) with maintaing/expanding upon existing modx sites. But never build one from scratch.

Now to make things a bit worse for myself, I am building 2 websites at the same time. And first I was doing this in 2 clouds, 2 repos as well as 2 basically the same set-ups (anything new from 1 I would put over to the other). So I decided to try and go set-up a multi-domain set-up in 1 cloud and make it 1 repo as they are both going to be personally used websites only.

So far so good… both links work for now.(The under construction basic pages I created)

[www.kroketgames.com](http://www.kroketgames.com)  
[www.108commandotroepen.com](http://www.108commandotroepen.com)

Before I explain the issues I am having I will list the things I am using here:

- Modx Cloud with PHP 7.4

- Modx 3.0.1-pl

- 4 domains (1 for 108 and 3 for kroketgames)

- XRouting plug-in

- CrossContextSettings plug-in

- **If there are any documentations I missed that might be applicable feel free to just share a link with me as an answer.**

The issues I am running into:

1. Friendly URL’s is something I intend to use (but every attempt I tried, was without .htaccess settings and according to posts I saw this is probably the issue). Now the question regarding this point: Anyone able to point me in the direction of bare minimum .htaccess set-up with the use of multiple domains as well as FURL’s?  
(I am currently using the standard ht.access file unedited(that comes with the 3.0.1 install), as the website is pretty much closed off anyways)

2. Best practise for building up all the pages/FURL’s/redirects on a multi-domain environment (if anyone has any references to any relevant documentation, this would be very welcome)

3. Any generic best practise tips anyone might have for this type of set-up are also welcome. I am doing this on a trial & (alot of) error basis, and I don’t want to keep harassing modx support every day 😝 🙈!

Some screenshots of current settings used:

 ![image](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/2X/1/11d92d485791f41efab243fe12eea12fb3582a59.png)  
 ![image](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/2X/1/1c8c1c17927fa1e87b29f881b83f9008f218d78b.png)

As you can see its pretty basic at the moment.

Thank you for any help given.

Kind regards,

Werner,

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [July 20, 2022, 8:57am UTC](https://community.modx.com/t/multi-domain-set-up-in-1-modx-cloud/5583/2 "2022-07-20T08:57:31Z")

</div>

The standard _.htaccess_ file should work.

The _XRouting_ extra then switches to the correct context, based on the value `$_SERVER['HTTP_HOST']` of the request.

* * *

If it doesn’t work, maybe try to debug it as described here:

> **[GitHub - SEDAdigital/XRouting: XRouting is a simple plugin that handles requests...](https://github.com/SEDAdigital/XRouting#troubleshooting)**
>
> XRouting is a simple plugin that handles requests for different contexts in MODX Revolution. It automatically switches the context based on a (sub)domain AND/OR subfolder.

* * *

Also, I believe that the `site_url` context setting should contain `https://`.

---

<div class="post-metadata">

**Author:** ![werner-NL](https://community.modx.com/letter_avatar_proxy/v4/letter/w/aca169/32.png) [@werner-NL](https://community.modx.com/u/werner-NL)\
**Post date:** [July 20, 2022, 3:54pm UTC](https://community.modx.com/t/multi-domain-set-up-in-1-modx-cloud/5583/3 "2022-07-20T15:54:41Z")

</div>

> Also, I believe that the `site_url` context setting should contain `https://` .

That worked! Solved 1 thing I believed was a cache issue, but turned out to be this setting.

The part of the htaccess does not yet seem to work, but that might be (thought of that this morning) because it seems to use NGINX as a webserver:

 ![image](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/2X/e/e72139b95add2df2534c7ff7c5e40969db1f80b6.png)

So I will look into the syntax for that, as that is new for me. But from what I read on the web so far it should be fairly easy to translate syntax from Apache to nginx. So I will try and figure that out.

For now my question is answered, and any other generic advice is still welcome if people have some. But this thread can be closed if we want to keep it neat.

Kind regards,

Werner,
