How to exclude some posts from SSL?

Hello,
My Wordpress site’s SSL is provided by Cloudflare (SSL is “Flexible”, “Always Use HTTPS” is off, “Automatic HTTPS Rewrites” is off.) and I have the below code from
Really Simple SSL in .htaccess to redirect my site from http to https.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:CF-Visitor} ‘”scheme”:”http”‘
RewriteRule ^(.*)$ [https://%](https://%25/){HTTP_HOST}/$1 [R=301,L]
</IfModule>

I have some posts, which contain non-secure iframes. So I need to force these posts’ links to http.
How can I do that, please?

Which means you have no security. You should fix that first.

Pause Cloudflare and talk to your host to get your site properly secured.

My firend, my problem is finding a way to manage the HTTPS redirection of those posts to HTTP, not the security :slight_smile:

That is not exactly correct, as you currently do have an insecure site and that is an issue.

But if you do not need SSL, switch it to “Off”. This will also fix your HTTP issue you mentioned.

I don’t understand what’s the connection of these two!
Really Simple SSL says that my site is secured.
Youtube 2
However the surity is not the point in my question and I appreeciate it if someone can help me regarding the SSL exclusion of those posts.

Fair enough, as I mentioned in my previous posting switch the encryption mode to “Off” and your link will be on HTTP as you asked.

I would like to have my site with HTTPS, and my problem is just with some posts.
Thanks for your points, but switiching the whole HTTPS of the site off because of some posts, is not reasonable.

All right, but if you want SSL you need a certificate on your server to begin with, which brings us back to the original point.

Anyhow, what’s the domain?

I would recommend to first pause Cloudflare and make sure everything is set up properly as there are quite a few content issues right now. Once we have verified that we can take a look at any other issues.

You can pause Cloudflare on the Overview screen.

if you mean the bellow part, so I just disabled Cloudflare on my site.
Youtube 2
Now the site is disabled over HTTPS and looks very messy over HTTP

Great, that’s the right link.

But yeah, unfortunately your site is not properly configured, so there is an SSL issue and that’s exactly what is breaking your content. Keep Cloudflare paused for now and fix the server to make sure the site loads fine on HTTPS first.

Take a look at Let’s Encrypt and Cloudflare Origin certificates for that.

Unfortunately I’m not good at server management. I have no idea what you mean with “fix the server to make sure the site loads fine on HTTPS first”
As far as I know, this is being done through .htacess file, in which I can add the below code to that.

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

You don’t need to do this yourself, the person who manages your server has to fix that, for example your host.

What is comes down to is that your site needs to load fine on HTTPS first without Cloudflare.

Well, I’m managing my VPS unforunately :frowning:
It seems i managed to install the SSL certificate on the domain and now the site is redirecting to HTTPS correctly while Cloudflare id off. Just it is very slow.
Now what is the next step?

Yes, the site loads fine on HTTPS now. Well done, just keep in mind you will need to renew the certificate in a couple of months. Alternatively you can also get an Origin certificate which has a longer validity.

Anyhow, the next step would be to switch the encryption mode on Cloudflare to “Full Strict”.

Thanks :slight_smile:. So I just switched Cloudflare to “Full Strict”.
Shall I enable Cloudflare ?
and what’s next, please?

Yes, now you can unpause Cloudflare again.

And now back to the topic; How can I exclude those posts from SSL and redirect them to HTTP?

Can you provide a link which you’d like to keep on HTTP?