Page 1 of 1

How do I redirect all traffic to the https:// domain?

Posted: Thu Jun 22, 2017 10:18 am
by Spythe
Hey guys,

I've setup Vesta and added SSL support for all domains with Let's Encrypt. When manually typing https://domain.com it'll show the site with SSL turned on, but when I just type domain.com it'll always navigate to the non-SSL http:// variant.

How do I make all traffic, per domain or all domains all together (since all domains will have SSL) go automatically to https://domain.com ?

I already googled and saw lots of suggestions, including server {} blocks, which I pasted within the http {} part in the /etc/nginx/nginx.conf file and restarted the server, but that didn't change a thing..

Re: How do I redirect all traffic to the https:// domain?

Posted: Thu Jun 22, 2017 11:56 am
by tjebbeke
You can do this in htaccess.
https://stackoverflow.com/questions/104 ... h-htaccess

Code: Select all

RewriteEngine On
 RewriteCond %{HTTPS} !=on
 RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]