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.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi!
I don’t see any rules that might cause an https->http redirect. What web app are you running on that domain name? Is it possible that it might be causing the redirect? Does it also happen in a different browser or in private/incognito mode?
Or, if you do not mind, please post the domain name so that I can see if it’s the same on my end.
Hello,
You can try with some of the following rules:
The following forces any http request to be rewritten using https. For example, the following code forces a request to http://example.com to load https://example.com. It also forces directly linked resources (images, css, etc.) to use https:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
The below code when added to an .htaccess file will automatically redirect any traffic destined for http: to https:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
Let me know how it goes.
Regards, Alex
Try the following config. Restart your server without fail .It works on Centos 7
nossl.conf
<VirtualHost *:80>
ServerName yoursite.com
ServerAlias www.yoursite.com
DocumentRoot /var/www/yoursite.com/public_html
<Directory "/var/www/ranmarc.com/public_html">
Options FollowSymLinks MultiViews
# AllowOverride controls what directives may be placed in .htaccess files.
AllowOverride All
# Controls who can get stuff from this server file
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/www/yoursite.com/error.log
CustomLog /var/www/yoursite.com/requests.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =yoursite.com [OR]
RewriteCond %{SERVER_NAME} =www.yoursite.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>
ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName yoursite.com
ServerAlias www.yoursite.com
DocumentRoot /var/www/yoursite.com/public_html
<Directory "/var/www/yoursite.com/public_html">
Options FollowSymLinks MultiViews
# AllowOverride controls what directives may be placed in .htaccess files.
AllowOverride All
# Controls who can get stuff from this server file
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/www/yoursite.com/error.log
CustomLog /var/www/yoursite.com/requests.log combined
SSLCertificateFile /etc/letsencrypt/live/yoursite.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/yoursite.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/yoursite.com/chain.pem
</VirtualHost>
</IfModule>