The fix has worked. But why hasn’t it done this before? I’ve have had to add that code to the .htaccess file on other non-Worpdress websites I’ve built in the past. I never thought I’d need it for WordPress.
It hasn’t done it because that’s the way it’s supposed to work. “It’s not an issue, it’s a feature”. ??
Most browsers, when you type say “example.com” will first go to
https://example.com
then try
https://www.example.com
Only then giving up and returning an error if there’s nothing there.
If you want visitors to be redirected to httpS:// – you must do it “manually”, .htaccess rule being a nice and practical way for that.
Should WordPress do that automatically when you set its address to https://example.com?
That would take some thinking and consideration. Depending on one’s setup, it could create problems to some people, some of the time. Here’s one example (not related to https, but nonetheless):
https://stackoverflow.com/questions/9924987/how-to-stop-sub-directory-inheriting-parents-htaccess-rules
The way it’s implemented now with WordPress (ie. no automatic .htaccess edits related to redirections to https): it is all under user’s control, though it requires some action on their part.
I wrote more on redirects in a blog post, primarily for my own future reference when fixing problems:
https://io.bikegremlin.com/5561/optimization-02-redirects/