Mobile app version of vmapp.org
Login or Join
Ann8826881

: Root Domain Redirects Incorrectly To Https instead of to WWW Why do visits to my website work without "www", but not to specific pages on it? I recently moved my website to a new webhost,

@Ann8826881

Posted in: #Cname #Redirects #Subdomain

Why do visits to my website work without "www", but not to specific pages on it?

I recently moved my website to a new webhost, RedHat's OpenShift (a PAAS). It requires using Cname records to setup custom domains, something my domain name registar (1&1) does not support without a hosting plan. So instead I setup Cloudflare in-between my domain and web host, and setup a Cname record on it. I then pointed a 1&1 "www" sub-domain to CloudFlare, and then pointed my 1&1 root to "www" sub-domain.

This works fine for visiting to my homepage, but for some reason it does not work when visiting a specific page without "www". Instead of adding "www", it goes to HTTPS, which is strange.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Ann8826881

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

Looking at the HTTP headers is key. You can use this tool: www.rexswain.com/httpview.html Or you can use curl at the command line:

curl -I zappable.com/2012/11/chart-for-learning-a-programming-langauge/ HTTP/1.1 302 Found
Server: cloudflare-nginx
Date: Mon, 26 Nov 2012 21:36:52 GMT
Content-Type: text/html; charset=iso-8859-1
Connection: keep-alive
Location: zappable.com/2012/11/chart-for-learning-a-programming-langauge/ Set-Cookie: __cfduid=db936b1575b9f27157d63fbcc2bd7a99b1353965811; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.zappable.com


You will see here that Cloudlflare is returning a Location directive that is causing the redirect. This could be:


Some CloudFlare rewrite or security rule is causing the redirect.
Your source server is sending the redirect due to incorrect re-write
rules.


I suspect #2 .

This appears to be WordPress, so make sure you have not accidentally set https somewhere in WP for the default URL.

I would also check any rewrite rules to see if they are forcing the HTTPS redirect. If your server sends the redirect then CloudFlare will simple cache it.

To test OpenShift directly, you can put CloudFlare in bypass mode or change your local host file to point to the IP that your side resides on.

You can then use curl to check the headers and find the re-direct.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme