# About force www to non www

**URL:** https://meta.discourse.org/t/about-force-www-to-non-www/105433
**Category:** Support
**Created:** [01.Январь.2019 23:58:42 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433 "2019-01-01T23:58:42Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [01.Январь.2019 23:58:42 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/1 "2019-01-01T23:58:42Z")

</div>

Hello everyone,

I am sorry i am new.

My site redirect to now www succesfully only if i browse `https://www.mydomain.com` but is i browse `https://www.mydomain.com/xyz` chrome gives SSL errror.

But if i browse `http://www.mydomain.com/xyz` there is no problem and it directs to `https://mydomain.com` succesfully.

Thank you in advance.

---

<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: [02.Январь.2019 05:23:23 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/2 "2019-01-02T05:23:23Z")

</div>

How are you doing the redirection?

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [02.Январь.2019 20:40:06 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/3 "2019-01-02T20:40:06Z")

</div>

I am not sure. I only installed discourse how it described on [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [02.Январь.2019 21:08:54 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/4 "2019-01-02T21:08:54Z")

</div>

So there’s nothing else on the server, you created a certificate using letsencrypt, you aren’t using Cloudflare and didn’t edit the app.yml directly?

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [02.Январь.2019 21:10:07 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/5 "2019-01-02T21:10:07Z")

</div>

Yes. i did not any modification and i do not use cloudflare.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [02.Январь.2019 21:13:52 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/6 "2019-01-02T21:13:52Z")

</div>

So how are you redirecting [http://www.mydomain.com/xyz](http://www.mydomain.com/xyz) to [https://mydomain.com](https://mydomain.com) ? Discourse doesn’t do this by default.

It sounds like domain redirection by your registrar, as you’ve not given us any details of the real domain we can’t troubleshoot, you will need to start there.

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [02.Январь.2019 21:36:38 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/7 "2019-01-02T21:36:38Z")

</div>

thanks,

Please see ;

[![](https://img.youtube.com/vi/P0JLi40rOKo/maxresdefault.jpg "Manufox Gıda Sektörüne Özel ERP - Reçete Oluşturma #reçete #erp #gıdamühendisi #izlenebilirlik") ](https://www.youtube.com/watch?v=P0JLi40rOKo)

[http://www.fstdesk.com/xyz](http://www.fstdesk.com/xyz) **OK**

[https://www.fstdesk.com/xyz](https://www.fstdesk.com/xyz) **NOK**

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [02.Январь.2019 21:42:38 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/8 "2019-01-02T21:42:38Z")

</div>

Correct, because Discourse is registered to [http://fstdesk.com/](http://fstdesk.com/) as seen in your certificate:

`common name: fstdesk.com`

Your certificate doesn’t include a subject alternate name for [https://www.fstdesk.com](https://www.fstdesk.com) so the webserver can’t honor that request without first issuing a certificate with a SAN including the WWW entry.

Google Chrome will handle root redirects, but only in the case of @ → www and www → @ - if you try the same URLs in Safari you will note that [https://www.fstdesk.com](https://www.fstdesk.com) also returns the error.

In short this isn’t an error, it wouldn’t work at all if you weren’t using Chrome, which tries to correct mistyped root domains.

Your options are:

- Reconfigure your let’s encrypt to include the subject alternate name [www.fstdesk.com](http://www.fstdesk.com) - this will mean changes to the configuration of your Discourse installation, guides already exist here to achieve this.
- Manage your redirects outside of Discourse

The simplest option is the second one, services such as Cloudflare can catch and redirect all traffic in this way with no Discourse configuration changes whatsoever.

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [02.Январь.2019 21:46:42 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/9 "2019-01-02T21:46:42Z")

</div>

Thank you.

but while [http://www.fstdesk.com](http://www.fstdesk.com) directs to [https://fstdesk.com](https://fstdesk.com) , [https://www.fstdesk.com](https://www.fstdesk.com) does not ?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [02.Январь.2019 21:48:18 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/10 "2019-01-02T21:48:18Z")

</div>

Correct, to redirect HTTPS the server first has to make a secure connection, which requires with a certificate that includes the www entry. Your server can’t redirect requests for HTTPS without a certificate which first allows it. That’s option one, modifying your server to include [www.fstdesk.com](http://www.fstdesk.com) so that it can respond to requests made to [www.fstdesk.com](http://www.fstdesk.com).

The redirect you see from [https://www.fstdesk.com](https://www.fstdesk.com) to [https://fstdesk.com](https://fstdesk.com) is being done by your browser, not your server.

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [02.Январь.2019 21:53:06 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/11 "2019-01-02T21:53:06Z")

</div>

> [@Stephen](#):
>
> That’s option one, modifying your server to include [www.fstdesk.com](http://www.fstdesk.com) so that it can respond to requests made to [www.fstdesk.com](http://www.fstdesk.com).

How can i do this ? Thank you.

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [02.Январь.2019 21:56:25 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/12 "2019-01-02T21:56:25Z")

</div>

But why while [https://www.fstdesk.com](http://www.fstdesk.com/) directs to [https://fstdesk.com](https://fstdesk.com/) , [https://www.fstdesk.com/xyz](https://www.fstdesk.com/) does not ?

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [02.Январь.2019 21:59:46 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/13 "2019-01-02T21:59:46Z")

</div>

Interesting, the url sometimes redirects sometimes does not

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [02.Январь.2019 22:06:36 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/14 "2019-01-02T22:06:36Z")

</div>

It doesn’t, what’s happening is this:

[http://fstdesk.com/](http://fstdesk.com/) → exists in DNS, redirects to [https://fstdesk.com/](https://fstdesk.com/) and is therefore **VALID**

[Brix Mühendislik | Gıda Mühendisliği Hizmetleri](https://www.fstdesk.com/xyz) exists in DNS but no certificate exists → **INVALID**

Chrome knows that there’s no certificate for [www.fstdesk.com](http://www.fstdesk.com) but has a feature called SSLCommonNameMismatchHandling which will check for a version without the www and redirect there.

If you try a different browser like safari you will also see the error for [http://www.fstdesk.com/](http://www.fstdesk.com/)

Chrome effectively tricked you into believing you had a redirect which was failing in certain cases, where no redirect exists and instead a feature just made it look like some but not all [https://www](https://www) addresses were valid.

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [02.Январь.2019 22:09:01 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/15 "2019-01-02T22:09:01Z")

</div>

Try this;

> **[Brix Mühendislik | Gıda Mühendisliği Hizmetleri](https://brix.tr/)**
>
> Brix Mühendislik, Gıda Mühendisliği Hizmetleri. Gıda ürün geliştirme, proses eğitimleri, danışmanlık hizmetleri ve blog yazılarına ulaşın.

it works. .

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [02.Январь.2019 22:15:44 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/16 "2019-01-02T22:15:44Z")

</div>

Only in Chrome, look at Safari:

 ![03%20PM](https://global.discourse-cdn.com/meta/original/3X/1/b/1b3e3b5c77a99e218d024a89e39d1ceb32a703f6.png)

If we sidestep the browser completely and talk to your server using cURL we get:

```
* Server certificate:
* subject: CN=fstdesk.com
* start date: Jan 1 20:57:46 2019 GMT
* expire date: Apr 1 20:57:46 2019 GMT
* subjectAltName does not match www.fstdesk.com
* SSL: no alternative certificate subject name matches target host name 'www.fstdesk.com'

```

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [02.Январь.2019 22:20:39 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/17 "2019-01-02T22:20:39Z")

</div>

So how can i add [www.fstdesk.com](http://www.fstdesk.com) for letsencrypt. Thanks for help.

---

<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: [03.Январь.2019 01:26:34 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/18 "2019-01-03T01:26:34Z")

</div>

> [@ufukayyildiz](#):
>
> So how can i add [www.fstdesk.com](http://www.fstdesk.com) for letsencript

[Set up Let’s Encrypt with multiple domains / redirects](https://meta.discourse.org/t/setting-up-let-s-encrypt-with-multiple-domains/56685) offers some hints, but it’s not exactly what you’re looking for. You’ll need to modify those instructions to do what you want.

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [03.Январь.2019 22:40:40 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/19 "2019-01-03T22:40:40Z")

</div>

thank you Jay Pfaffman

---

<div class="post-metadata">

### Author: ![ufukayyildiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufukayyildiz/32/217157_2.png) [@ufukayyildiz](https://meta.discourse.org/u/ufukayyildiz)
#### Post date: [04.Январь.2019 17:14:33 UTC](https://meta.discourse.org/t/about-force-www-to-non-www/105433/20 "2019-01-04T17:14:33Z")

</div>

i can not solve the problem. any support please. Thanks

[Следующая страница](https://meta.discourse.org/t/about-force-www-to-non-www/105433.md?page=2)
