This is what your htaccess should look like (or a variation of this):
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://www.domain.com/$1 [R=301,L]
Then every piece of traffic will be redirected to https
That is one of the ones I tried and unfortunately it doesn’t work.
I just copied this to my .htaccess file again to be sure and it didn’t make any difference.
Any other ideas?
Thanks,
Brandon
I have this in my htaccess and it works perfectly.
You might have browser caching issues that you need to look at
Shannon,
I know, it is super frustrating. I have several sites that are fine, but this one is being a pain in the neck.
I know it isn’t a caching problem since I’ve tried it on multiple computers and on Browserstack.
It might be an issue with the server too, I’m not sure.
Thanks,
Brandon
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
It’s your server. Your using 2 separate web servers for http (nginx) and https (Apache2).
The .htaccess doesn’t work on the nginx that you use for http.
$ curl -I http://blog.epiccosplay.com/
HTTP/1.1 301 Moved
Server: nginx
Date: Wed, 09 Dec 2015 02:45:18 GMT
Content-Type: text/html; charset="utf-8"
Content-Length: 98
Connection: keep-alive
Location: https://:2083/
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
And your HTTPS version is doing this correctly.
$ curl -I https://blog.epiccosplay.com/
HTTP/1.1 200 OK
Date: Wed, 09 Dec 2015 02:46:23 GMT
Server: Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips mod_bwlimited/1.4
X-Powered-By: PHP/5.4.38
X-Pingback: https://blog.epiccosplay.com/xmlrpc.php
Link: <https://wp.me/2CVoj>; rel=shortlink
Vary: User-Agent,Accept-Encoding
Content-Type: text/html; charset=UTF-8
Can you get your host to add this for your nginx config?
location / {
return 301 https://$http_host$request_uri;
}
That goes inside your server section of the config and will redirect to the https version of your site.
Tested right now from Paris (Fiber 500Mb/s), blank page now.
And i confirm, if you’re on Nginx, check all that like Jan Dembowski advises you.
I thought of a wrong SSL certificate, but wrong idea you can do that later, https will work even if not exactly authentified.
I’m more worried about ports for Nginx, default https:// port on server that should be setup for WP and so (Nginx default port: 8080 on http).
Thank you a ton guys. That was exactly the problem. I’m not sure why Nginx was installed on that server, but I disabled it and now the redirect works perfectly.
I did try the code above in the config file, but for some reason it didn’t work.
I definitely appreciate all of the help.
Brandon