I have PHP website (will call it awesomedomain.com from now on.) currently load balanced in Elastic Beanstalk with SSL up and running.
I can obtain a secure connection to the site with https://awesomedomain.com/ however whenever I enter "awesomedomain.com" it still connects as unsecure port.
I have two listeners 80 and 443 set-up. How can I route all coming traffic to port 443 for global SSL connection?
Thanks to anyone beforehand.
Cheers,
~bio
You can set two ways :
NameVirtualHost *:80
<VirtualHost *:80>
ServerName abc.example.com
Redirect permanent / https://abc.example.com/
</VirtualHost>
<VirtualHost _default_:443>
ServerName abc.example.com
DocumentRoot /var/www/html/example
SSLEngine On
</VirtualHost>
Don't forget to restart server after this changes.
.htaccess
file :RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}