SSL Certificate and Browser still shows Unsecured

**Operating system:**C
**OS version:**7

Hi, I had to clear cache on all my browsers and now all my subs with SSL installed, and not Wordpress are showing to be unsecured. Is there an additional install I need to make it all secured?.. The sites with Wordpress are working properly. Thanks…

I’ve tried using these and no luck. RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^12.123.123.123$ [NC,OR]
RewriteCond %{HTTP_HOST} ^domain.tld [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domain.tld/$1 [R=301,L]

Anyone have any idea?..

Are they going to http rather than https?

Or are they going to https and causing a browser warning?

Richard

If the redirect to https isn’t happening, and you’re in a subserver, then I think this, if placed as the first stanza in the sub’s .htaccess, would work:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://sub.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

I could be wrong. It’s happened.

Richard

Thanks Rich. I’m away this weekend but I’ll try when I return. TY

Hi, I tried the above and it still doesn’t resolve to https…

To be clear, is it a http connection or https?
Unsecure could also mean its a mixed content warning.

Either you setup virtualmin to redirect http to https by default or you use .htaccess as an example.
If you use .htaccess already, then please show us the content of it (related to the redirection).

Edit:
The following code should actually do the trick:

RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

TY. I actually used this before and it worked. I tried using the one Rich suggested and it’s not working. I have several subs with WP installed and are working properly. My only guess is that, I don’t have anything installed on it yet and just testing with the html file added when the sub is created. But, then again, I have phpmyadmin set up on a sub as well and it doesn’t redirect to https either…

That sounds like you didnt enable the automated redirect to SSL secured connections.
You can enable that if you like. I would suggest that if you are knowing what you are doing and okay with the “downsides”. Otherwise place that code I posted inside the .htaccess file on every domain.
Even though I dont really need it, its default in my files.

O.K. They’re working. It was actually the period missing from the .htaccess file… Thank you all.

2 Likes

That’ll do it. Apache is very picky about syntax in the .htaccess files. There may be multiple ways to do the same thing, but the one you pick must have correct syntax.

Also, the last line in the file should be blank (that is, hit “Return” after the last line of text).

Richard

It was interesting because I had downloaded the file from another server of mine but, I couldn’t get this one to work. I realized that, when downloading, the period gets stripped… :slight_smile:

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.