My website doesnt redirect traffic to https

ayawn.ct.ws

Error Message

i dont see an error message but some poeple said they cant open the site because it shows up as not secure on their end but when i send them the link with https:// in the beginning, it works

Other Information

i am using this .htaccess code and my .htaccess is placed inside the htdocs

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]

Welcome to the community.
For me, it does redirect all traffic to HTTPS, which likely means it’s due to their browser cache. Ask them to clear their browser cache

4 Likes

i checked redirects using several websites but it shows that my website still uses http and doesnt redirect, i asked chatgpt and it said that this doesnt work because .htaccess is for apache servers only and my website is running openresty which is basically nginx.

Welcome to the forum :slight_smile:

Before moving to a custom domain and cloudflare to force HTTPS I used:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

and that worked fine. so yours looks like it should work.

Having visited your site myself, it automatically redirects to HTTPS for me too. What websites have you used to check the redirects?

4 Likes

Are you using an online tool to check the redirect? Because most of them will not work due to this security system:

So, the best way to check if forced HTTPS is working or not is to do it manually. If it doesn’t work, try clearing the cache. Because your site is forcing HTTPS when I visit it.

Actually, free hosting web servers use a combination of Nginx and Apache, which means .htaccess will work. So, ChatGPT is somewhat wrong here.

9 Likes

thank you i was skeptical because of the sites telling me im not using https but now my doubt is cleared thank you very much

2 Likes

yes i am also using something similar and its working i just was skeptical and thanks for replying

2 Likes

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