# Redirect HTTP to HTTPS

**URL:** https://community.ovhcloud.com/t/redirect-http-to-https/26333
**Category:** Domaines et Hébergements
**Created:** [Novembre 2, 2020, 2:36 UTC](https://community.ovhcloud.com/t/redirect-http-to-https/26333 "2020-11-02T14:36:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![SaraM4](https://community.ovhcloud.com/letter_avatar/saram4/32/5_5575768a8748004e209b776fc1b2916d.png) [@SaraM4](https://community.ovhcloud.com/u/SaraM4)
#### Post date: [Novembre 2, 2020, 2:36 UTC](https://community.ovhcloud.com/t/redirect-http-to-https/26333/1 "2020-11-02T14:36:40Z")

</div>

Hi,   
  
I know this is a recurrent issue, but I've tried multiple configurations and support tickets, all without success.  
  
**Goal:** all HTTP traffic must be redirect to HTTPS  
**Current State:** base domains %{SERVER\_NAME}.com and www.%{SERVER\_NAME}.com are successfully redirected to HTTPS, **but** http://%{SERVER\_NAME}.com is not  
  
My current setup is:  
 - .htaccess:  
 RewriteEngine On  
 RewriteCond %{HTTPS} !=on  
 RewriteRule ^/?(.\*) https://%{SERVER\_NAME}/$1 [R=301,L]  
  
 - SSL Gateway enabled. Both www.%{SERVER\_NAME} and %{SERVER\_NAME} pointing to designated IP address, as IPv4-A OVH redirections   
  
Thanks in advance
