# Https certificate not working with www

**URL:** <https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569>\
**Category:** Help\
**Created:** [November 15, 2018, 9:46am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569 "2018-11-15T09:46:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![schtipoun](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@schtipoun](https://community.letsencrypt.org/u/schtipoun)\
**Post date:** [November 15, 2018, 9:46am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/1 "2018-11-15T09:46:16Z")

</div>

My domain is: [doctowait.fr](http://doctowait.fr)

I ran this command: my webserver is hosted on Amazon EC2 (Amazon Linux 2) and I used this procedure to get my certificate ([https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-an-instance.html#letsencrypt](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-an-instance.html#letsencrypt))

I’ve put both [doctowait.fr](http://doctowait.fr) and [www.doctowait.fr](http://www.doctowait.fr) in my httpd.conf file and I had both lines here

```
Which names would you like to activate HTTPS for? 
------------------------------------------------------------------------------- 
1: doctowait.fr
2: www.doctowait.fr
------------------------------------------------------------------------------- 
Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel):

```

And I had this message at the end

```
Congratulations! You have successfully enabled https://example.com and
https://www.example.com

```

My /etc/httpd/conf/httpd-le-ssl.conf file looks like this.

```
<IfModule mod_ssl.c>
<VirtualHost *:443>
DocumentRoot "/var/www/html"
ServerName "doctowait.fr"
ServerAlias "www.doctowait.fr"
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/doctowait.fr/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/doctowait.fr/privkey.pem
</VirtualHost>
</IfModule>

```

So I don’t understand why I can access my website through [doctowait.fr](http://doctowait.fr) and can’t through [www.doctowait.fr](http://www.doctowait.fr).

If you have any idea 🙂

---

<div class="post-metadata">

**Author:** ![sahsanu](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/sahsanu/32/89984_2.png) [@sahsanu](https://community.letsencrypt.org/u/sahsanu)\
**Post date:** [November 15, 2018, 9:55am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/2 "2018-11-15T09:55:19Z")

</div>

Hi @schtipoun,

I’ve no problem to access your site:

![imagen](https://global.discourse-cdn.com/letsencrypt/original/3X/1/3/1320db5ca1e8394900e533343f523ceba110a1f7.jpeg)

And your certificate issued on 11/11 is covering both domains with and without www:

 ![imagen](https://global.discourse-cdn.com/letsencrypt/original/3X/c/0/c0aa3180e66a84bd844e961b04314ff16033a5d1.png)

Maybe it is a browser’s cache problem…

Cheers,  
sahsanu

---

<div class="post-metadata">

**Author:** ![schtipoun](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@schtipoun](https://community.letsencrypt.org/u/schtipoun)\
**Post date:** [November 15, 2018, 9:56am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/3 "2018-11-15T09:56:16Z")

</div>

😯

And you entered [www.doctowait.fr](http://www.doctowait.fr) ?

---

<div class="post-metadata">

**Author:** ![sahsanu](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/sahsanu/32/89984_2.png) [@sahsanu](https://community.letsencrypt.org/u/sahsanu)\
**Post date:** [November 15, 2018, 9:58am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/4 "2018-11-15T09:58:36Z")

</div>

> [@schtipoun](#):
>
> And you entered [www.doctowait.fr](http://www.doctowait.fr) ?

Yes, I entered `www.doctowait.fr` 😉

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [November 15, 2018, 9:59am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/5 "2018-11-15T09:59:49Z")

</div>

Hi @schtipoun

> [@schtipoun](#):
>
> and can’t through [www.doctowait.fr](http://www.doctowait.fr)

additional: I see no problem with your certificates. www and non-www are correct.

The only thing:

| [http://doctowait.fr/](http://doctowait.fr/) | 301 | [https://www.doctowait.fr](https://www.doctowait.fr) | 1.694 | E |
| --- | --- | --- | --- | --- |
| | | | | |
| • [http://www.doctowait.fr/](http://www.doctowait.fr/) | 301 | [https://www.doctowait.fr](https://www.doctowait.fr) | 0.077 | A |
| | | | | |
| • [https://doctowait.fr/](https://doctowait.fr/) | 200 | | 0.150 | B |
| | | | | |
| • [https://www.doctowait.fr](https://www.doctowait.fr) | 200 | | 0.043 | B |
| | | | | |
| • [https://www.doctowait.fr/](https://www.doctowait.fr/) | 200 | | 0.154 | B |

You have 3 versions with https + 200. So your redirect http+www -\> https+www should have a /.

And you should have a preferred version (www or non-www) and a redirect non-preferred -\> preferred).

---

<div class="post-metadata">

**Author:** ![schtipoun](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@schtipoun](https://community.letsencrypt.org/u/schtipoun)\
**Post date:** [November 15, 2018, 10:01am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/6 "2018-11-15T10:01:21Z")

</div>

Alright, cool.  
I’m automatically redirected to [https://doctowait.fr](https://doctowait.fr) when I enter [www.doctowait.fr](http://www.doctowait.fr) (so I never see [https://www.doctowait.fr](https://www.doctowait.fr) in the URL bar of my browser).  
But you might be right about browser’s cache problem.

Thanks for replying so quick 👍🏼

---

<div class="post-metadata">

**Author:** ![schtipoun](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@schtipoun](https://community.letsencrypt.org/u/schtipoun)\
**Post date:** [November 15, 2018, 10:09am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/7 "2018-11-15T10:09:24Z")

</div>

Thanks for your additional information.

What I want is for the user to see [https://www.doctowait.fr](https://www.doctowait.fr) on the URL bar when they browse my website.  
So I need to check my web redirection.

Which tool did you use to have all the versions?

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [November 15, 2018, 10:15am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/8 "2018-11-15T10:15:08Z")

</div>

> [@schtipoun](#):
>
> Which tool did you use to have all the versions?

This is my own tool. Created in the last weeks because of the questions in this forum. It's not possible to check such redirects with a browser, because the browser caches 301 - redirects. But checking 4 - 6 urls manual (offline) isn't good.

> **[Make your website better](https://check-your-website.server-daten.de/?q=doctowait.fr)**
>
> Check your redirects http - https, your preferred version (www vs. non-www), certificates, connections and your html-content. A ranking system shows, if your domain is A+ (no errors + preload), has errors (https - http) or loops.

> [@schtipoun](#):
>
> What I want is for the user to see [https://www.doctowait.fr](https://www.doctowait.fr) on the URL bar when they browse my website.  
> So I need to check my web redirection.

First correct your basic redirects http/domain -\> https/domain, not a domain change.

Then add a https redirect non-www -\> www.

---

<div class="post-metadata">

**Author:** ![schtipoun](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@schtipoun](https://community.letsencrypt.org/u/schtipoun)\
**Post date:** [November 15, 2018, 10:18am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/9 "2018-11-15T10:18:00Z")

</div>

Alright, thanks for this information 🙂

---

<div class="post-metadata">

**Author:** ![mnordhoff](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mnordhoff/32/22583_2.png) [@mnordhoff](https://community.letsencrypt.org/u/mnordhoff)\
**Post date:** [November 15, 2018, 10:19am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/10 "2018-11-15T10:19:53Z")

</div>

I don’t know what the DNS records were like a few minutes ago, but right now `www.doctowait.fr` is a `CNAME` to `doctowait.fr`, and `doctowait.fr` has no `A` or `AAAA` records. 😕

---

<div class="post-metadata">

**Author:** ![sahsanu](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/sahsanu/32/89984_2.png) [@sahsanu](https://community.letsencrypt.org/u/sahsanu)\
**Post date:** [November 15, 2018, 10:27am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/11 "2018-11-15T10:27:00Z")

</div>

@mnordhoff, my cached dns shows this:

```
$ dig www.doctowait.fr +short
doctowait.fr.
35.180.161.80

$ dig doctowait.fr +short
35.180.161.80

```

But you are right, right now the A record for `doctowait.fr` has gone…

```
$ dig @a.root-servers.net doctowait.fr +trace +nodns 

; <<>> DiG 9.11.1 <<>> @a.root-servers.net doctowait.fr +trace +nodns
; (2 servers found)
;; global options: +cmd
. 518400 IN NS a.root-servers.net.
. 518400 IN NS b.root-servers.net.
. 518400 IN NS c.root-servers.net.
. 518400 IN NS d.root-servers.net.
. 518400 IN NS e.root-servers.net.
. 518400 IN NS f.root-servers.net.
. 518400 IN NS g.root-servers.net.
. 518400 IN NS h.root-servers.net.
. 518400 IN NS i.root-servers.net.
. 518400 IN NS j.root-servers.net.
. 518400 IN NS k.root-servers.net.
. 518400 IN NS l.root-servers.net.
. 518400 IN NS m.root-servers.net.
;; Received 811 bytes from 2001:503:ba3e::2:30#53(a.root-servers.net) in 12 ms

fr. 172800 IN NS d.ext.nic.fr.
fr. 172800 IN NS d.nic.fr.
fr. 172800 IN NS e.ext.nic.fr.
fr. 172800 IN NS f.ext.nic.fr.
fr. 172800 IN NS g.ext.nic.fr.
;; Received 349 bytes from 199.7.83.42#53(l.root-servers.net) in 33 ms

doctowait.fr. 172800 IN NS ns-162-c.gandi.net.
doctowait.fr. 172800 IN NS ns-181-a.gandi.net.
doctowait.fr. 172800 IN NS ns-139-b.gandi.net.
;; Received 147 bytes from 193.176.144.22#53(e.ext.nic.fr) in 13 ms

doctowait.fr. 10800 IN SOA ns1.gandi.net. hostmaster.gandi.net. 1542276262 10800 3600 604800 10800
;; Received 101 bytes from 2604:3400:aaac::a3#53(ns-162-c.gandi.net) in 22 ms

```

@schtipoun Did you modify your DNS records?.

Cheers,  
sahsanu

---

<div class="post-metadata">

**Author:** ![schtipoun](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@schtipoun](https://community.letsencrypt.org/u/schtipoun)\
**Post date:** [November 15, 2018, 10:35am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/12 "2018-11-15T10:35:28Z")

</div>

Yes, I did redirect all the traffic coming from \*.doctowait.fr to [https://www.doctowait.fr/](https://www.doctowait.fr/) but it looks like I did something wrong 😕

---

<div class="post-metadata">

**Author:** ![mnordhoff](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mnordhoff/32/22583_2.png) [@mnordhoff](https://community.letsencrypt.org/u/mnordhoff)\
**Post date:** [November 15, 2018, 10:36am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/13 "2018-11-15T10:36:58Z")

</div>

Redirect how? What DNS Records do you have now in Gandi’s control panel?

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [November 15, 2018, 10:37am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/14 "2018-11-15T10:37:42Z")

</div>

> [@schtipoun](#):
>
> Yes, I did redirect all the traffic coming from \*.doctowait.fr to [https://www.doctowait.fr/](https://www.doctowait.fr/)

Redirects are a thing of your webserver configuration, not your dns settings.

Check your ReWrite - rules of your vHosts.

---

<div class="post-metadata">

**Author:** ![schtipoun](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@schtipoun](https://community.letsencrypt.org/u/schtipoun)\
**Post date:** [November 15, 2018, 10:40am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/15 "2018-11-15T10:40:00Z")

</div>

![14](https://global.discourse-cdn.com/letsencrypt/original/3X/0/a/0aac6b64b84cd4e540571f651188ec697a61a02d.png)

I have this on Gandi. If I put [https://www.doctowait.fr](https://www.doctowait.fr) instead of [https://doctowait.fr](https://doctowait.fr) in the redirection, it doesn’t work.  
I’m kinda confused on what I should do on Gandi and on my webserver.

---

<div class="post-metadata">

**Author:** ![schtipoun](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@schtipoun](https://community.letsencrypt.org/u/schtipoun)\
**Post date:** [November 15, 2018, 10:40am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/16 "2018-11-15T10:40:34Z")

</div>

Ok, I’ll check that on an another website of mine.  
I’ve done it well on that time but forgot since ^^

---

<div class="post-metadata">

**Author:** ![sahsanu](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/sahsanu/32/89984_2.png) [@sahsanu](https://community.letsencrypt.org/u/sahsanu)\
**Post date:** [November 15, 2018, 10:45am UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/17 "2018-11-15T10:45:04Z")

</div>

Hi @schtipoun,

Once you fix your dns issue...

> [@schtipoun](#):
>
> [  
> Capture d’écran 2018-11-15 à 11.38.14.png1836x146 16.8 KB  
> ](https://global.discourse-cdn.com/letsencrypt/original/3X/0/a/0aac6b64b84cd4e540571f651188ec697a61a02d.png)
> 
> I have this on Gandi. If I put [https://www.doctowait.fr](https://www.doctowait.fr) instead of [https://doctowait.fr](https://doctowait.fr) in the redirection, it doesn’t work.  
> I’m kinda confused on what I should do on Gandi and on my webserver.

http redirections are fine, all of them redirect to `https://www.doctowait.fr` and if you want to redirect also `https://doctowait.fr` to `https://www.doctowait.fr` you should edit the file `/etc/httpd/conf/httpd-le-ssl.conf` so it looks like this:

```
<IfModule mod_ssl.c>

<VirtualHost *:443>
ServerName "doctowait.fr"
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/doctowait.fr/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/doctowait.fr/privkey.pem
Redirect permanent / https://www.doctowait.fr/
</VirtualHost>

<VirtualHost *:443>
DocumentRoot "/var/www/html"
ServerName "www.doctowait.fr"
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/doctowait.fr/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/doctowait.fr/privkey.pem
</VirtualHost>

</IfModule>

```

Cheers,  
sahsanu

---

<div class="post-metadata">

**Author:** ![schtipoun](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@schtipoun](https://community.letsencrypt.org/u/schtipoun)\
**Post date:** [November 15, 2018, 3:25pm UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/18 "2018-11-15T15:25:50Z")

</div>

Thanks for your advices.

I’ve changed the settings accordingly.  
Now, anything you enter ([doctowait.fr](http://doctowait.fr), [www.doctowait.fr](http://www.doctowait.fr), etc.) redirects to [https://www.doctowait.fr](https://www.doctowait.fr) so that’s great.  
But, the URL is unreachable.  
I can access the website by its IP address but not by https.  
My A record is still in the Gandi DNS.  
I’m sure it’s something stupid but I can’t find it 😕

---

<div class="post-metadata">

**Author:** ![schtipoun](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@schtipoun](https://community.letsencrypt.org/u/schtipoun)\
**Post date:** [November 15, 2018, 3:29pm UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/19 "2018-11-15T15:29:57Z")

</div>

I’ve used JuergenAuer’s tool ([https://check-your-website.server-daten.de/?q=doctowait.fr](https://check-your-website.server-daten.de/?q=doctowait.fr)) and the result is really strange.

 ![44](https://global.discourse-cdn.com/letsencrypt/original/3X/b/9/b9fff0794c1e0af36dbe09c55aebe9179ce4b275.png)

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [November 15, 2018, 3:32pm UTC](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569/20 "2018-11-15T15:32:07Z")

</div>

> [@schtipoun](#):
>
> and the result is really strange.

Looks only like a caching problem. I use the normal dns server of the datacenter.

[Next page](https://community.letsencrypt.org/t/https-certificate-not-working-with-www/77569.md?page=2)
