I am having a bit of trouble getting SSL to work on one of my sites. Here is the setup:

Bluehost is the hosting provider, wildcard SSL purchased from them.
2 WordPress installs, one at domain.com, the other at stuff.domain.com, housed in the subfolder stuff, within the main domain’s folder.
The stuff subdomain is an e-commerce site running the WooCommerce wordpress plugin. The only place I really need SSL is at https://stuff.domain.com/checkout

I initially followed Bluehosts instructions for setting up the htaccess files for allowing ssl, and they 404’d. I then contacted Bluehost support and was told because I’m using wordpress it needs extra rules, blah blah blah, and they got me the point I am now, being unwilling (or unable) to help further.

Current situation is as follows:

  • https works on any page within domain.com
  • The front page of stuff.domain.com works on https
  • When you attempt to load any other stuff.domain.com page over https you get redirected to the main domain.com site, at which point you get a 404, unless of course the mains site happens to have a page with the same permalink as the page you intended to go to. This of course makes it difficult to get to https stuff.domain.com/checkout, as that pushes you to https domain.com/checkout which doesn’t exist.

Here are the htaccess files for the two sites.

domain.com:

RewriteOptions inherit
RewriteEngine on
# Custom subdomain .htaccess SSL + WordPress
RewriteCond %{HTTP_HOST} ^stuff.domain.com$
RewriteCond %{REQUEST_URI} !^/stuff/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /stuff/$1
RewriteCond %{HTTP_HOST} ^stuff.domain.com$
RewriteRule ^(/)?$ stuff/index.php [L]
# End custom subdomain .htaccess
# Custom maindomain .htaccess WordPress
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^index.php$ - [L]
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# End custom maindomain .htaccess
# BEGIN WordPress
# END WordPress

stuff.domain.com:

RewriteOptions inherit
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

If anyone could offer some help, that would be amazing. I have almost no experience with htaccess and ssl.

Please note that simply checking the Force SSL checkbox in WooCommerce does not work. It creates the same results as above.

Read more here: I’m having difficulty with SSL and WordPress


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, ,

Wordpress related questions and answers: