Under Full SSL > Sub Domains Redirect to Main Website

ssl

#1

Hello,

What have I missed or done wrong here? I enabled FULL SSL for the domain.

Always USE HTTPS = ON
HTTP Strict Transport Security (HSTS) - DISABLED
Nothing in Page Rules for Redirection

SSL is working perfectly for the main domain.
However visiting a http://subdomain.domain.com redirects to https://www.domain.com
The subdomain is “ORANGE” cloud on Cloudflare. If I make it a grey cloud the sub domain works perfectly without redirection.

Have I missed something?
I don’t care if the subdomain has SSL or Not, I just don’t want it to redirect anywhere. There are no redirections at Origin for the sub domain.

This is what looks like through a checker:
http://subdomain.domain.com >301 Redirect to https://subdomain.domain.com >301 Redirect to https://www.domain.com < Status 200

Many Thanks


#2

You have Cloudflare set to require SSL but when connected to your origin sever via SSL it redirects to the WWW site (indicating it is likely an issue with your Apache config).

HTTP/1.1 301 Moved Permanently
Date: Mon, 25 Sep 2017 22:12:35 GMT
Server: Apache
X-Pingback: https://www.yourdomain.com/xmlrpc.php
Location: https://www.domain.com/
Cache-Control: max-age=2592000
Expires: Wed, 25 Oct 2017 22:12:35 GMT
Content-Type: text/html; charset=UTF-8


#3

I don’t think it is caused by Apache or another server on our side, nor that issue does nothing to do with SSL settings.

I’m having the same problem and here is my configuration as fallows:

I’ve created a subdomain like: xxx.domainA.tld => ip address with A type.

Then I need to add another domain to the same IP address.

So I’ve created domainB.tld record as domainB.tld => same ip address with A type.

When I requested domainB.tld, I get this reply:

HTTP/1.1 301 Moved Permanently
Date: …some date…
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Location: https://xxx.domainA.tld/
Server: cloudflare-nginx
CF-RAY: …some id…

If I continue to add another subdomains or domains to the same IP address (which I’ve already tried). cloudflare always redirects to the first configured domain record.

So I’m stuck too :frowning:


#4

His issue was definitely Apache as I connected directly to his origin server to verify the response I was receiving. If you gray cloud in DNS the record does it work differently? If not, it isn’t a Cloudflare issue.


#5

Hey @erakan - Not sure if you have fixed it or not, I’m a bit late.

The way I ended up fixing it was I went into my cloudflare account Crypto > Origin Certificates and created a free certificate for the sub domain. I then went into cpanel and installed the free certificate under the subdomain I wanted protected. Once I did this, it stopped redirecting and started serving the page under full SSL.