.htaccess redirection issues


#1

I installed the LetsEncrypt SSL successfully from my hosting.

Now when I type my website and press CTRL+Enter it gives me.

`This site can’t provide a secure connection

www[dot]topseokeywords[dot]com sent an invalid response.
Try:
Reloading the page
Learn more about this problem.
ERR_SSL_PROTOCOL_ERROR`

It should redirect from https://www.topseokeywords.com to https://topseokeywords.com

My .htaccess file is:

`# BEGIN HTTPS Redirection Plugin

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

END HTTPS Redirection Plugin

BEGIN rlrssslReallySimpleSSL rsssl_version[2.3.3]

END rlrssslReallySimpleSSL

BEGIN WordPress

RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

END WordPress`

Same issue is with my other website. I am using Google Chrome, Win 10 with Win Defender


#2

www.topseokeywords.com resolves to a CloudFlare IP, while topseokeywords.com doesn’t. Could that be the problem?


#3

If I disable the Cloudflare services (which is by default turned on from my hosting) will it resolve the issue? And can I turn it back later on?


#4

I’m not exactly sure why it’s failing with a SSL protocol error on the CloudFlare-enabled domain. It’s worth noting that when CloudFlare is enabled, SSL is terminated on a CloudFlare server, so the protocol error you’re seeing is generated by CloudFlare, and not by your server. CloudFlare, however, allows you to enable SSL for their sites, and usually does so by default. Maybe your web host disabled that feature and you need to enable it somewhere in the control panel (either your web host’s or CloudFlare’s)?


#5

I think you’ve disabled CloudFlare now… Unfortunately, the DNS entry for www.topseokeywords.com is still pointing to CloudFlare, perhaps just temporary.

From my point of view, when using the “real” (i.e.: non-CloudFlare) IP address, I can see everything is working perfectly with OpenSSL.


#6

The trick worked.

CNAME | www.topseokeywords.com. | cloudflare-resolve-to.topseokeywords.com

I disabled and re-enabled it. It is working now. Can you please check at your end by opening topseokeywords and press CTRL+Enter

======UPDATE=====

It didn’t work after I tried opening it in different browser.

So I disabled the Cloudflare CNAME entry for www.

Now both websites are working.


#7

Well, CloudFlare isn’t happy about your domain (www nor non-www):

osiris@desktop ~ $ openssl s_client -connect 104.28.12.28:443 -servername topseokeywords.com
CONNECTED(00000003)
139890005145232:error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error:s23_clnt.c:769:

But when connecting to your IP, thus bypassing CloudFlare, everything works like a charm.


#8

@Osiris Does this show any issues in my .htaccess or something else? I am asking just for my knowledge. Because website is working fine, I’m happy.


#9

Don’t think so. The redirect works fine. (Although redirecting non-HTTPS www.~ to HTTPS www.~ to HTTPS non-www is rather cumbersome, but hey, it works :stuck_out_tongue:)

If you’ve disabled CloudFlare, it’s probably just a DNS caching issue.


#10

If you expose your real IP anyway, I think there is really no need to use Cloudflare.

Especially as Cloudflare is MITM-build-in.