Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

By Sherlasm
PROBLEM:
I have an SSL certificate from a vendor installed and I want all visitors who come via HTTP to be redirected to HTTPS website-wide, but no matter what I try, I cannot figure out how to do it here. After more than a day trying many suggestions from numerous forums and Digital Ocean’s tutorials, I still cannot get it and I am running out of options. I tried:
a) The permanent redirect in the port 80 Host configuration file(mysite.com.conf): “Redirect permanent / https://mysite.com/." That always results in a redirect loop.
b) I have tried implementing numerous suggestions from multiple forums and blogs as to rewriting rules in mysite.com.conf. Again, I either get the loop, or no redirecting to HTTPS.
c) I tried editing the .httaccess file. No redirecting to HTTPS.
Can anyone provide a substantive guide as to how to trouble shoot this?
My configuration is underneath the line below.THANKS!
LAMP
I have two virtual hosts, one for port 80 ( etc/apache2/sites-available/mysite.com.conf) and another for port 443( /sites-available/mysite-sll.conf).
The port 80 host’s configuration is as follows:
ServerName mysite.com ServerAlias www.mysite.com DocumentRoot /var/www/mysite/public <Directory /var/www/mysite/public>
Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </Directory>
The port 443 host’s configuration is as follows:
<IfModule mod_ssl.c> <VirtualHost default:443>
ServerName mysite.com ServerAlias www.mysite.com DocumentRoot /var/www/mysite/public SSLEngine on SSLCertificateFile /etc/ssl/private/mysite_com.crt SSLCertificateKeyFile /etc/ssl/private/mysite.com.key SSLCertificateChainFile /etc/ssl/private/client.crt