I have my Amazon linux server and I had installed httpd24 and mod24_ssl. I had been setup ssl certificate in /etc/httpd/conf.d/ssl.conf
file with https redirect instructions:
<VirtualHost *:80>
ServerName example.com:80
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>
<VirtualHost _default_:443>
ServerName example.com:443
SSLEngine on
SSLProtocol -All +TLSv1 +TLSv1.1 +TLSv1.2
SSLProxyProtocol all -SSLv3
SSLHonorCipherOrder on
SSLCertificateFile /etc/example.com/cert.pem
SSLCertificateKeyFile /etc/example.com/privkey.pem
SSLCertificateChainFile /etc/example.com/chain.pem
</VirtualHost>
But the httpd
starts normally without any issue. But the redirection is not working. I have other file /etc/httpd/conf/httpd.conf
here. What I might have missed.? I come across many articles but those didn't solve my problem.