Let's encrypt not redirecting to www(https).

Support for security such as Firewalls and securing linux
Post Reply
zndytz
Posts: 2
Joined: 2019/08/02 14:01:27

Let's encrypt not redirecting to www(https).

Post by zndytz » 2019/08/10 12:18:44

Hello, I have installed ssl to my site but something is off, when I access my site on non-www(no https) it should be redirected to www(https) since I force it on the htaccess to work like that for non-www, but it's not working but before I install the ssl certificates the redirection from non-www(no https) to www(no https) is working fine. Just wondering is there a settings I should adjust on the ssl installation? Any help is appreciated, thanks.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Let's encrypt not redirecting to www(https).

Post by hunter86_bg » 2019/08/15 19:27:31

Can you paste your redirect rule here?

zndytz
Posts: 2
Joined: 2019/08/02 14:01:27

Re: Let's encrypt not redirecting to www(https).

Post by zndytz » 2019/08/18 00:41:02

Hello thanks for the reply, I figured out the problem it's on the ssl side, somehow you can also assign an ssl to non www which I did with this:

Code: Select all

sudo certbot --authenticator standalone --installer apache -d yoursite.com -d www.yoursite.com --pre-hook "apachectl stop" --post-hook "apachectl start"
Then I restarted the server, which now make a redirection from non www to www.

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Let's encrypt not redirecting to www(https).

Post by aks » 2019/08/20 18:32:59

You're missing the point. Certbot does NOT send an HTTP redirect Apache (in your case) does. Tell Apache to redirect. Better yet, have a read of Apache's (extensive) documents and a little read of TLS and then maybe you'd get a clue.

Post Reply