Found a pretty simple and to the point tutorial explaining how to redirect all HTTP requests to HTTPS on Wordpress -> https://wp-mix.com/htaccess-redirect-http-to-https/. Only these won't work if you're using Cloudflare as your server.
If you add rules to your htaccess file to set up the redirect, you will see that the browser says "the website redirected too many times" or something like that.
hmmm.........
Few simple steps to add the redirect: (you don't need the htaccess):
- Head to Cloudflare Dashboard.
- Click on the website that needs the redirect.
- Go to SSL/TSL tab.
- Find the setting called "Automatic HTTPS Rewrites". If it is off and grey. Turn it on and it should turn [green].
Ok.
Now we create a post. Can't. Because Wordpress fails to save any changes made in the editor.
Wordpress says "updating failed you are probably offline". Why?
In the General Settings of your Wordpress, the site url is still http://yourwebsite.com and not https://yourwebsite.com
As per Wordpress documentation, the website url in General Settings matter a lot:
These settings control the display of the URL in the admin section of your page, as well as the front end, and are used throughout the WordPress code.
It should be https://yourwebsite.com . It can't be changed from the Wordpress CMS. You'll have to head to the backend files.
Found this tutorial -> https://wordpress.org/support/article/changing-the-site-url/
In the tutorial, there are many different ways to change the address of where your website is served from. Why? Which one is the best? Does it depend on the server?
Didn't work, probably because of some reason related to the server being on Cloudflare.
I didn't try all the methods given in the tutorial above. You go ahead, try them all. Did you make it work? *gentle pats on your back*
If it doesn't work - Anywho...somehow..for whatever precise reason, you can't add a new post now.
Install a plugin called - reallysimpleSSL. It will make sure that all content on your website including JS, CSS, yada yada, is served through HTTPS. Problem solved.
There definitely must be a way to do it by modifying one of the Wordpress files. I'll find it if I remember I want to find it and post here.


Comments
Post a Comment