php - Setting default Wordpress in https:// and redirecting it to http:// and forwarding http:// to https:// in Cloudflare -


  • earlier have set default wordpress install http:// , redirected in cloudflare use https ssl, got several mixed content errors on browsers[stating requests https http].

  • so, fresh installed whole wordpress use https:// i'm on shared server no ssl certificate installed, whole site redirects https:// , displays [server not found error].

  • i need keep wordpress in https:// only, in order work sitemaps , other plugins access https:// without conflicting.

- so, need re-direct https:// http:// in .htaccess file , later redirect http:// cloudflare use https://, being default wordpress installed https://

  • have used several rules in .htaccess no avail, let me know exact rule redirect http:// 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 server don't listen on 443 port, can't redirect them way.

and if there invalid certificate, there "invalid certificate" error on redirect. should work this:

rewriteengine on rewritecond %{https} on rewriterule (.*) http://%{http_host}%{request_uri} 

you should try grab valid certificate. https://letsencrypt.org/ , https://www.startssl.com/ ways start free.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -