# Www to non www with https

**URL:** https://meta.discourse.org/t/www-to-non-www-with-https/284916
**Category:** Support
**Created:** [November 9, 2023, 8:27am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916 "2023-11-09T08:27:01Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Jishan\_Ansari](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jishan_ansari/32/337293_2.png) [@Jishan\_Ansari](https://meta.discourse.org/u/Jishan_Ansari)
#### Post date: [November 9, 2023, 8:27am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916/1 "2023-11-09T08:27:02Z")

</div>

how to redirect www to non www with HTTPS  
but in safari give error

 ![Screenshot 2023-11-09 at 1.56.00 PM](https://global.discourse-cdn.com/meta/original/4X/d/1/3/d13b10fce75b3fd87131eb4b5cb4417cae28b654.png)  
any one help me please

---

<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: [November 9, 2023, 8:56am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916/2 "2023-11-09T08:56:48Z")

</div>

Do you have a certficate for both urls?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [November 9, 2023, 8:58am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916/3 "2023-11-09T08:58:31Z")

</div>

Yep that’s your first and main problem, see:

> [@Set up Let’s Encrypt with multiple domains / redirects](https://meta.discourse.org/t/set-up-let-s-encrypt-with-multiple-domains-redirects/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: ![Jishan\_Ansari](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jishan_ansari/32/337293_2.png) [@Jishan\_Ansari](https://meta.discourse.org/u/Jishan_Ansari)
#### Post date: [November 9, 2023, 10:41am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916/4 "2023-11-09T10:41:24Z")

</div>

its not work for me  
please give me another way to solve this issue

---

<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: [November 9, 2023, 10:52am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916/5 "2023-11-09T10:52:26Z")

</div>

Your sertificate is for `supportgroupsnew.com`, not for `www.supportgroupsnew.com`. So you should recheck your settings. How did you exacly

- did redirection
- got certificate for www-url (and are you telling that certificate too; that depends how you did redirecting)

Shortly — we need more info about what you have done.

---

<div class="post-metadata">

### Author: ![Jishan\_Ansari](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jishan_ansari/32/337293_2.png) [@Jishan\_Ansari](https://meta.discourse.org/u/Jishan_Ansari)
#### Post date: [November 9, 2023, 10:58am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916/6 "2023-11-09T10:58:26Z")

</div>

can you please give me the exact steps to install a certificate to [www.](http://www.supportgroupsnew.com)

---

<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: [November 9, 2023, 11:37am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916/7 "2023-11-09T11:37:09Z")

</div>

No I can, because I don’t know your setup — are you using a reverse proxy, done it using docker or something else.

Perhaps you could tell what you hqve done so far?

---

<div class="post-metadata">

### Author: ![Jishan\_Ansari](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jishan_ansari/32/337293_2.png) [@Jishan\_Ansari](https://meta.discourse.org/u/Jishan_Ansari)
#### Post date: [November 9, 2023, 11:40am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916/8 "2023-11-09T11:40:13Z")

</div>

# - exec: /var/www/discourse/customize/script.sh

---

<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: [November 9, 2023, 11:44am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916/9 "2023-11-09T11:44:01Z")

</div>

Your hostname is without www, so you will get a certificate for that, not for www.etc.

And where and how did you do redirection?

---

<div class="post-metadata">

### Author: ![Jishan\_Ansari](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jishan_ansari/32/337293_2.png) [@Jishan\_Ansari](https://meta.discourse.org/u/Jishan_Ansari)
#### Post date: [November 9, 2023, 11:57am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916/10 "2023-11-09T11:57:41Z")

</div>

can you please help me redirection

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [November 13, 2023, 1:05am UTC](https://meta.discourse.org/t/www-to-non-www-with-https/284916/11 "2023-11-13T01:05:16Z")

</div>

You can follow the above link that has instructions to request both certs. On those instructions don’t make sense (and really, even if they do) I recommend that you put your site on www and use [forcewww.com](http://forcewww.com) to do the redirect.

Browsers hide the www from the user (and most don’t notice urls at all), so there is no benefit in using the bare domain.
