-
Earlier i have set my default WordPress install to http:// and redirected it in Cloudflare to use Https SSL, but got several mixed content errors on browsers[stating requests for https is http].
-
So, fresh installed my whole wordpress to use https:// but i’m on a shared server with no SSL certificate installed, so now my whole site redirects to https:// and displays [Server not found error].
-
I need to keep my wordpress in https:// only, in order to work with sitemaps and other plugins to access only to the https:// without conflicting.
– So, do i need to Re-direct all https:// to http:// in .htaccess file and later redirect the http:// into cloudflare to use https://, with being my default WordPress installed to be https://
-
Have used several rules in .htaccess but no avail, Let me know the exact rule to redirect all http:// to https://
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] #RewriteEngine On RewriteCond %{SERVER_PORT} 443 RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
If your server don’t listen on the 443 Port, you can’t just redirect them that way.
And if there is just an invalid certificate, there will always be the “invalid certificate” error on redirect. But it should work like this:
You should try to grab an valid certificate.
https://letsencrypt.org/ and https://www.startssl.com/ are good ways to start for free.
Did you fix the problem? Maybe you need to add this to your wp-config.php
It tells your wordpress virtual machine to use the (cloudflare) hostname on the wordpress server. If SSL is done by cloudflare this can work because traffic behind the LoadBalance ist non-ssl traffic. But I dont know Cloudflare details at all 😉
Also, you need to set the wordpress homeurl and siteurl to the https domain which your users should see.