I have an Ubuntu 14.04 server running Apache2 and 2 subdomains. One subdomain runs a WordPress site and the other a custom PHP site.
It was running flawlessly before installing the certs after following the instructions here.
I installed them and everything appeared to still run flawlessly. I tested both sites myself as well as with https://www.ssllabs.com/ssltest. Everything seemed totally fine. No problems whatsoever.
Then I reactivated cloudflare and all hell broke loose. All sites were giving infinite redirect errors. I thought the problem was an incorrect configuration with CloudFlare, so I disabled it, but this did not fix the infinite redirects. I couldn’t do anything except restore a backup.
I would really like to get this working with SSL but I’m not sure where to begin or even what went wrong.
Thanks.
Update: This seems to be covered here, however, it isn’t at all clear what needs to be changed to what in the config files.
I would start with opening Network tab in Developer’s Console of your browser for example to get a better understanding of what is happening and what redirects where. For example, it could be that the URL you are requesting redirects to itself, or it could be that it is actually redirecting to another URL, which bounces back.
Additionally, if you are using Firefox for example, I would check the option to “Disable cache” in the console options - sometimes browsers could be very “clingy” and even when the problem is fixed, you might still see the redirect.
I have not been able to trouble shoot this successfully.
The method I tried was as follows. Set up a dev server with the certificates installed. Edit my /etc/hosts file so I see the dev server instead of the live server.
Try to do what you suggested above. Even after a reboot somehow I still get the live server wehn I visit www.domain.com or domain.com
When I visit subdomain.domain.com I get what I would expect but it appears to work and there is no redirect error.