Mobile app version of vmapp.org
Login or Join
Odierno851

: Wordpress blog subdomain redirects to main site after switching to HTTPS While there are a number of online instructions to change Wordpress from HTTP to HTTPS, they are not working for me,

@Odierno851

Posted in: #Https #Subdomain #Wordpress

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 www.example.com with non-HTTP requests being redirected via a 301 to the HTTPS version, same for non-www versions such as example.com. Everything here is working as expected. This is NOT a Wordpress site.
The Wordpress blog is at blog.example.com and worked perfectly as is.


To change Wordpress over to HTTPS, I did a global search for blog.example.com and replaced all occurrences by 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 ^/?(.*)$ blog.example.com/ [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 www.example.com, it has the rather unexpected behavior of no longer showing the blog. When accessing blog.example.com, the page shows the parent domain's content but not redirected. It still shows blog.example.com in the URL bar but the page itself is the same as 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 blog.example.com shows the content currently shown at blog.example.com?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Odierno851

1 Comments

Sorted by latest first Latest Oldest Best

 

@Pope3001725

Summarizing the scenario you've outlined in your post and in the comments:


SSL Certificate is a wildcard
Only the non https version of the subdomain loads
HTTPS request forfor the subdomain redirects to the parent domain


This sounds like a vhost configuration issue on the server. Chances are your webserver is missing a vhost for the SSL version of the subdomain.


Check to make sure there is vhost entry for subdomain on port 443, similar to the one for the primary domain.
Once the vhost is added, make sure it is also enabled (if Apache2). You can find an example tutorial of setting one up in this blog post.
If you just added a vhost and enabled it, or just updated an existing one, you'll also need to restart Apache for settings to kick-in.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme