• Hi,

    I have a SSL Wildcard from Cloudflare installed on my main domain and it works great with the main domain.
    The problem is with the subdomains. I just can’t get the SSL to work on the subdomains (which are also WordPress installations).
    Bluehost says to put this code on the main domain .htaccess. It works for the main domain, but not for the subdomains. The subdomain still works with http, but if I access it with https, the main page opens without CSS, and every link I click will just give an error.

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

    I’ve tried everything and still don’t have the subdomain running with SSL.
    Is there anyone who had the same problem and found a solution?

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello jpkapinha,
    Add the following code in your subdomain and domain .htaccess file:

    # BEGIN HTTPS
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    </IfModule>
    # END HTTPS

    Hope this will be helpful.

    I’m having the same problem except when I post the code given by Bluehost to the subdomain .htaccess file, I get a file not found error and cannot access the site at all.

    I tried adding the code given by cedcommerce above to both the domain and subdomain .htaccess file, but it didn’t solve the problem (still could not access the subdomain).

    Are there any other suggestions? Does it matter where or what order you paste the code? (I’m a novice at this)

    Thanks for any help!

    Hi there – I’m having the same problem – I tried jpkapinha’s code on Bluehost’s knowledgebase – that didn’t work – so I just tried cedcommerce’s code, that also didn’t work – when I do that and etner https://courses.wp-bff.com – it redirects me to my main site https://www.wp-bff.com – I also am a novice when it comes to setting up SSL on a subdomain – any help is greatly appreciated!

    Has anyone actually resolved this issue? I see these posts (and others much like it) are almost a year old now, and I’m not finding proper answers anywhere across the web.

    Is this something specific to Bluehost? For some reason I wouldn’t think so… But the code they themselves provide, as others here have described, simply does not work. Adding the other bit of code that actually mentions HTTPS doesn’t appear to fix it either.

    Wordpress automatically adds a chunk of <IfModule mod_rewrite.c> code to the htaccess file by default. Do these other pieces of code need to replace that, or be placed within that, or placed separately in a certain order? Is there one set of code to use on the top level htaccess and perhaps something different to use for the subdomain htaccess?…

    Can anyone provide a proper, complete sample .htaccess code that will implement our Positive Wildcard SSL on the top level domain, as well as our subdomains?

    Many questions with nothing but vague answers anywhere I’ve looked so far. I would venture to guess that most of us using WordPress are more focused on frontend site design and development, and less familiar with the finer details of SSL and htaccess code. It would be great to begin seeing these types of questions actually getting solid answers, and not just lingering on support forums like this for months and years.

    Thanks in advance to anyone who can shed some light on this topic.

    • This reply was modified 7 years, 9 months ago by guymon13.

    Has anyone actually resolved this issue? I see these posts (and others much like it) are almost a year old now, and I’m not finding proper answers anywhere across the web.

    Is this something specific to Bluehost? For some reason I wouldn’t think so… But the code they themselves provide, as others here have described, simply does not work. Adding the other bit of code that actually mentions HTTPS doesn’t appear to fix it either.

    Wordpress automatically adds a chunk of <IfModule mod_rewrite.c> code to the htaccess file by default. Do these other pieces of code need to replace that, or be placed within that, or placed separately in a certain order? Is there one set of code to use on the top level htaccess and perhaps something different to use for the subdomain htaccess?…

    Can anyone provide a proper, complete sample .htaccess code that will implement our Positive Wildcard SSL on the top level domain, as well as our subdomains?

    Many questions with nothing but vague answers anywhere I’ve looked so far. I would venture to guess that most of us using WordPress are more focused on frontend site design and development, and less familiar with the finer details of SSL and htaccess code. It would be great to begin seeing these types of questions actually getting solid answers, and not just lingering on support forums like this for months and years.

    Thanks in advance to anyone who can shed some light on this topic.
    (edit: reposted because this disappeared for some reason, edited for better detail)

    Hi, guymon13,

    I never found help online with mine. I ended up hiring an IT specialist (conveniently my nephew!) to fix the issue for me. Even he had a few issues but he got the SSL off my main domain (where I didn’t want it) and onto the subdomain where I did want it.

    Since then, I’ve installed several SSL cards on other first level domains without an issue. It is the subdomain/main domain issue on the wildcat card that is the issue. That and having the Bluehost tech do it. When I do it through the SSL portal on Bluehost, I’ve never had a problem!

    Goodluck fixing your issue. I really suggest getting IT help. It isn’t worth the hours of websearching.

    Thanks for the reply (and my apologies for my double post, not sure what happened there)…

    I have considered hiring outside help for this, but besides being a freelancer working on a strict budget, it strikes me as an issue that shouldn’t be shrouded in mystery to everyone else having these types of problems out there. I really hope this isn’t a thing where specialists out there are reading over these types of posts and withholding basic answers that could greatly help the open source community. Seems like I’ve found answers on more complex issues than this before, and this doesn’t strike me as an issue that would warrant some kind of proprietary industry secrets.

    Is there any possibility that you could share an example version of the htaccess code(s) that you ended up with? If not, can I hire your nephew? lol

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘.htaccess Wildcard SSL wordpress subdomain’ is closed to new replies.