www does not redirect properly after move to https

www does not redirect properly after move to https - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the www does not redirect properly after move to https error on your web browser. Problem :


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:



enter image description here



What am I doing wrong? Thanks!


Solution :

# 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.


We hope that this article has helped you resolve the redirects, https, no-www error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=