# SSL doesn't work

**URL:** <https://forum.infinityfree.com/t/ssl-doesnt-work/69864>\
**Category:** Hosting Support\
**Created:** [December 14, 2022, 11:43pm UTC](https://forum.infinityfree.com/t/ssl-doesnt-work/69864 "2022-12-14T23:43:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon99531952](https://forum.infinityfree.com/letter_avatar/anon99531952/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon99531952](https://forum.infinityfree.com/u/anon99531952)\
**Post date:** [December 14, 2022, 11:43pm UTC](https://forum.infinityfree.com/t/ssl-doesnt-work/69864/1 "2022-12-14T23:43:22Z")

</div>

[bestlife.epizy.com](http://bestlife.epizy.com)

I have installed an SSL certificate to my website [bestlife.epizy.com](http://bestlife.epizy.com)  
I have added  
Destination  
CNAME Record  
Private Key   
Certificate  
I did all steps but still, my site doesn’t redirect to HTTPS although added the  
RewriteEngine On  
RewriteCond %{HTTP:X-Forwarded-Proto} !https  
RewriteCond %{HTTPS} off  
RewriteCond %{HTTP:CF-Visitor} !{“scheme”:“https”}  
RewriteRule (.\*) https://%{HTTP\_HOST}%{REQUEST\_URI} [L,R=301]  
to htaccess file  
But still, the site redirects to HTTP is there any step to resolve this matter, please?

 ![Capture](https://forum-cdn.infinityfree.net/original/3X/5/3/531a5e7e3236222808b6b71b95b5cf50fa9a3be8.jpeg)

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [December 15, 2022, 12:17am UTC](https://forum.infinityfree.com/t/ssl-doesnt-work/69864/2 "2022-12-15T00:17:31Z")

</div>

SSL is working for me:

![image](https://forum-cdn.infinityfree.net/original/3X/2/f/2fcefa8c73667f162bc4f4d8f0a557b4f209218b.png)

Try this for the htaccess code:

```auto
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

```

Source: [https://tinkertechlab.com/webhosting/htaccess/force-traffic-to-https](https://tinkertechlab.com/webhosting/htaccess/force-traffic-to-https)

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [December 15, 2022, 12:54am UTC](https://forum.infinityfree.com/t/ssl-doesnt-work/69864/3 "2022-12-15T00:54:59Z")

</div>

Instead of

> [@anon99531952](#):
>
> RewriteEngine On  
> RewriteCond %{HTTP:X-Forwarded-Proto} !https  
> RewriteCond %{HTTPS} off  
> RewriteCond %{HTTP:CF-Visitor} !{“scheme”:“https”}  
> RewriteRule (.\*) https://%{HTTP\_HOST}%{REQUEST\_URI} [L,R=301]

You can also try this

```auto
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https [OR]
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP:CF-Visitor} !{“scheme”:“https”}
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

```

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [December 15, 2022, 9:45am UTC](https://forum.infinityfree.com/t/ssl-doesnt-work/69864/4 "2022-12-15T09:45:25Z")

</div>

I checked your account and I see the file name is incorrect.

The name of the file must be `.htaccess`. That’s with a dot at the start. If you omit the dot, the file won’t be used.

---

<div class="post-metadata">

**Author:** ![anon99531952](https://forum.infinityfree.com/letter_avatar/anon99531952/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon99531952](https://forum.infinityfree.com/u/anon99531952)\
**Post date:** [December 15, 2022, 9:57am UTC](https://forum.infinityfree.com/t/ssl-doesnt-work/69864/5 "2022-12-15T09:57:58Z")

</div>

You’re right Admin, I deleted the dot, I thought it plus  
It worked now, thank you very much

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [December 22, 2022, 9:58am UTC](https://forum.infinityfree.com/t/ssl-doesnt-work/69864/6 "2022-12-22T09:58:22Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
