www does not redirect properly after move to https
I recently moved my site (hosted on OpenShift) from HTTP to HTTPS. The domain name is registered at GoDaddy, but I use the DNS of Cloudflare. I had implemented a Cloudflare page rule to forward www to non-www. All was working fine.
I have now implemented HTTPS and the forwarding from www to non-www does not work anymore. It forwards to https://www.example.com/app instead of https://example.com and I get a 404 Not Found.
The current page rule on cloudflare is:

What am I doing wrong? Thanks!
# curl -IL http://www.ligatures.net/a.html -v
* Connection #0 to host www.ligatures.net left intact
* Issue another request to this URL: 'https://www.ligatures.net/a.html'
* Found bundle for host www.ligatures.net: 0x14103c0
* Adding handle: conn: 0x1410930
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x140f9c0) send_pipe: 0, recv_pipe: 0
* - Conn 1 (0x1410930) send_pipe: 1, recv_pipe: 0
* About to connect() to www.ligatures.net port 443 (#1)
* Trying 54.80.18.246...
* Connected to www.ligatures.net (54.80.18.246) port 443 (#1)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* Server certificate:
* subject: CN=*.rhcloud.com,OU=RHC Cloud Opoerations,O=Red Hat Inc,L=Raleigh,ST=North Carolina,C=US,serialNumber=LnhzJHxcX0bIdlH2ITnDgaewey8ce5g3
* start date: Feb 02 19:15:37 2013 GMT
* expire date: May 08 01:49:13 2015 GMT
* common name: *.rhcloud.com
* issuer: CN=GeoTrust SSL CA,O="GeoTrust, Inc.",C=US
* NSS error -12276 (SSL_ERROR_BAD_CERT_DOMAIN)
* Unable to communicate securely with peer: requested domain name does not match the server's certificate.
* Closing connection 1
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate
You would need to following: https://access.redhat.com/documentation/en-US/OpenShift_Online/2.0/html-single/User_Guide/index.html#sect-Custom_Domains_and_SSL_Certificates to get your ssl and domain setup correctly.
It could just be a misconfigured .htaccess file. If you don't have an .htaccess file that could be it, too. Check it to see if there is any forwarding rules in there, and change it from http to https if there are.
Comments
Post a Comment