# Setup discourse for the main site (www.example.com) not on a subdomain

**URL:** https://meta.discourse.org/t/setup-discourse-for-the-main-site-www-example-com-not-on-a-subdomain/205253
**Category:** Support
**Created:** [October 5, 2021, 12:08pm UTC](https://meta.discourse.org/t/setup-discourse-for-the-main-site-www-example-com-not-on-a-subdomain/205253 "2021-10-05T12:08:40Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![kforr](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@kforr](https://meta.discourse.org/u/kforr)
#### Post date: [October 5, 2021, 12:08pm UTC](https://meta.discourse.org/t/setup-discourse-for-the-main-site-www-example-com-not-on-a-subdomain/205253/1 "2021-10-05T12:08:40Z")

</div>

Hi,  
I have discourse set up on Azure.  
However I don’t want it to be on a subdomain.  
I want it on the main site which is [www.example.com](http://www.example.com) or just [example.com](http://example.com)  
Try to find it in this forum but without luck, just want to check if this is not possible?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 5, 2021, 12:11pm UTC](https://meta.discourse.org/t/setup-discourse-for-the-main-site-www-example-com-not-on-a-subdomain/205253/2 "2021-10-05T12:11:12Z")

</div>

[www.example.com](http://www.example.com) is a subdomain. 👍

But you can also install it on a root domain too ([example.com](http://example.com)), it’s just not recommended.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [October 5, 2021, 12:12pm UTC](https://meta.discourse.org/t/setup-discourse-for-the-main-site-www-example-com-not-on-a-subdomain/205253/3 "2021-10-05T12:12:01Z")

</div>

> [@JammyDodger](#):
>
> it’s just not recommended.

I’m just curious — but why not?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 5, 2021, 12:19pm UTC](https://meta.discourse.org/t/setup-discourse-for-the-main-site-www-example-com-not-on-a-subdomain/205253/4 "2021-10-05T12:19:13Z")

</div>

I’m trying to dig out the topic I read it in, but it’s proving elusive…

From memory, I think it’s okay if you’ve decided there’s definitely never going to be anything other than your forum on that domain. If you add more content on subdomains later then it can cause some conflicts (something about sticky cookies?).

There may be other reasons too. 🙂

---

<div class="post-metadata">

### Author: ![kforr](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@kforr](https://meta.discourse.org/u/kforr)
#### Post date: [October 5, 2021, 12:33pm UTC](https://meta.discourse.org/t/setup-discourse-for-the-main-site-www-example-com-not-on-a-subdomain/205253/5 "2021-10-05T12:33:26Z")

</div>

Thank you! I’ll give it a try tomorrow! 🙂

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 5, 2021, 12:39pm UTC](https://meta.discourse.org/t/setup-discourse-for-the-main-site-www-example-com-not-on-a-subdomain/205253/6 "2021-10-05T12:39:35Z")

</div>

I also found this tip really useful to get a letsencrypt certificate working for both [www.example.com](http://www.example.com) as well as the [example.com](http://example.com) address. 👍

> [@Set up Let’s Encrypt with multiple domains / redirects](https://meta.discourse.org/t/setting-up-let-s-encrypt-with-multiple-domains/56685):
>
> NOTE: @pfaffman says: This page needs to be cleaned up. There is now a new ENV setting that will let you add more hostnames. In your app.yml under your DISCOURSE\_HOSTNAME line (it can go many places but that one makes sense), add DISCOURSE\_HOSTNAME\_ALIASES: domain.com,other.domain.com and early reports suggest that you’ll get valid certs for those domains and that accessing https://domain.com will properly redirect you to your DISCOURSE\_HOSTNAME without a certificate error. If you do that an…

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [October 5, 2021, 1:29pm UTC](https://meta.discourse.org/t/setup-discourse-for-the-main-site-www-example-com-not-on-a-subdomain/205253/7 "2021-10-05T13:29:45Z")

</div>

if you set your DNS records so that the A Record for both points to discourse, then its possible.
