Www. subdomain not working with .htaccess

My website url is aleksavuc.cf. In past couple of hours i added SSL certificate. So I needed to redirect all htt{p:// to htt{ps:// . Please read this post before moving it to “already seen” or redirecting me to https://infinityfree.net/support/how-to-make-your-website-use-https/.

In the upcoming text you will see {} between links- that is beacuse new users can not post more than 2 links per post.

I tried about 50 different .htaccess files from ethenet but no one worked with www{.}aleksavuc{.}cf.
At last I tried one from post I just mentioned and had this results →
htt{ps:/}/aleksavuc{.}cf (working)
htt{p://aleksavuc{.}cf pointing to https:/{}/aleksavuc{.}cf (working)
htt{p://www.aleksavuc{.}cf working for 1 or 2 times and then giving “This site can’t be reached” error. This error can be removed sometimes with deleting browser(history, cookies,…) but after couple of times running the site, it begins to return error.
https:/{/www.ale{}ksavuc.cf (for first it worked well now it is same as http://www{.}aleksavuc{.}cf)

The following .htaccess code is:

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

I am running simple HTML site with only htdocs folder which contains .htaccess and index.html files.
I also tried CloudFlare full SSL configuration but it did not have impact.

I am really sorry if for my grammar or spelling errors i just spent about 4 hours looking for this to work.
Any help/support would be appreciated.

It says that the server is not found. Check nameservers. To make sure they are set to InfinityFree’s nameserver.

My nameservers:


https://aleksavuc.cf/ is working fine while https://www.aleksavuc.cf/ does not.

Um, it doesn’t work for me.

1 Like

I just tried using firefox (I use chrome by default) and (https://aleksavuc.cf/) is still working while (https://www.aleksavuc.cf/) not works.

How old is the site (From creation)? If it is less than 72 hours, I will have to wait.

Site was made 24 hours ago.
Update: just aleksavuc.cf with https:// works for me now. http:// or www. does not work anymore. If I remove my .htaccess file everything will work exept it will not redirect to SSL version.

Update: I just tested https:// version of the site and it is not working after couple of times refreshng page. I guess i will just remove .htaccess file if no one gives me solution.

Can you paste here codes of your .htaccess?

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

I wrote everything but someone flaggeed everything as spam.

Have you figured anything? My complete website has shut down. I think I will just remove .htaccess file tommorow and resolve this issue later. Problem might be with structure of my files which are
htdocs (folder)
I am complete beginer to HTML and/or making websites. I do not know where I make error lease help me.

The issue appears to be that the DNS records for your domain name have gone. This can happen if you’ve used our Cloudflare integration while also making manual changes to Cloudflare’s DNS CNAME records through your control panel.

To fix this, all you need to do is enable Cloudflare again through your control panel, and then disable it again. That typically helps to make sure that all records are installed correctly on your domain.

Note that it may still take a while for the new DNS records to start working everywhere. You should be able to see your IP address appear (it will start with 185.27.134) here:


Thank you very much.
It was problem I was messing with CNAME RECORDS in order to make .htaccess work.
I just did what you suggested and it solved all my problems.
Thank you again.

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