While there are a number of online instructions to change Wordpress from HTTP to HTTPS, they are not working for me, probably because my installation is in a subdomain.
Here is the starting situation:
- The main website is at https://www.example.com with non-HTTP requests being redirected via a 301 to the HTTPS version, same for non-www versions such as http://example.com. Everything here is working as expected. This is NOT a Wordpress site.
- The Wordpress blog is at http://blog.example.com and worked perfectly as is.
To change Wordpress over to HTTPS, I did a global search for http://blog.example.com and replaced all occurrences by https://blog.example.com both in the files (3 or 4 occurences) and in the database (1000s of occurences). Then added to the .htaccess of the subdomain which is hosted in a subdir (so public_html/blog/.htaccess whereas the site .htaccess is in public_html/.htaccess - all fairly standard configuration):
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*)$ https://blog.example.com/$1 [R=301,L]
The RewriteEngine On
line was already there, just one above where the two above were added.
While this has thankfully no impact on the site https://www.example.com, it has the rather unexpected behavior of no longer showing the blog. When accessing https://blog.example.com, the page shows the parent domain's content but not redirected. It still shows https://blog.example.com in the URL bar but the page itself is the same as https://www.example.com.
Just to confirm that those are the only changes made, I reverted and everything went back to normal.
Why does this show the parent domain?
What changes must be made so that https://blog.example.com shows the content currently shown at http://blog.example.com?