Unwanted Redirect - Sub.Domain to Another Domain

Hello CF Community.

Wanted to thank you and say you are awesome.

I have a subdomain (grz) setup in my cpanel and it points to /public_html with no redirect. The subdomain is part of a Wordpress multi-site. The subdomain will be mapped to a domain.

So when I go to the subdomain, it gets redirected to a completely different domain. Regardless if I type the subdomain in directly in the url bar, or I try to access the dashboard from the network admin dashboard, it redirects to a completely different domain.

My Cloudflare account has three sites. Let’s say domainA, domainB and domainC. The subdomain grz.domainA.com is redirecting to domainC.com.

I’ve deleted the grz sub domain from cpanel, CF, and deleted the site from the multisite. Then re-added everything with the same result. Additionally, the domainA and domainC are in separate cpanel accounts on the same VPS.

I was able to trace with redirect check (dot com) and here is the report. For security, I’ve replaced the domain names with DomainA and DomainC. I’ve made the text bold where I think the issue is. My issue is that I have no clue what to do!


HTTP/1.1 301 Moved Permanently
Date: Fri, 04 Aug 2017 02:45:46 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: max-age=3600
Expires: Fri, 04 Aug 2017 03:45:46 GMT
Location: https:// grz.domainA.com/
Server: Cloudflare-nginx
CF-RAY: 388e2exxxxx46ec-EWR


HTTP/1.1 301 Moved Permanently
Date: Fri, 04 Aug 2017 02:45:49 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d9d7de67d223cxxxxxxxxxxxfee9f2831501814748; expires=Sat, 04-Aug-18 02:45:48 GMT; path=/; domain=.domainA.com; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: PHPSESSID=h718s877xxxxxx3edlbmp2pj1; path=/
Vary: Accept-Encoding
Location: https ://domainC.com/
Server: Cloudflare-nginx
CF-RAY: 388e2xxxxxxcf1870-EWR


HTTP/1.1 200 OK
Date: Fri, 04 Aug 2017 02:45:50 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d983936070ae25xxxxxxxxfa338371501814750; expires=Sat, 04-Aug-18 02:45:50 GMT; path=/;domain=.domainC.com; HttpOnly
Vary: Accept-Encoding,Cookie
Last-Modified: Fri, 04 Aug 2017 01:44:50 GMT
Cache-Control: max-age=0, public
Expires: Fri, 04 Aug 2017 02:45:50 GMT
Pragma: public
Server: Cloudflare-nginx
CF-RAY: 388e2xxxxxxc2156-EWR

If you want the actual url I’d be glad to provide it in a private message.

Thank you!

1 Like

Not trying to bump this but just tested something and have to report it.

I created a new subdomain, gz.domainA.com and it is also redirecting to domainC.com.

There is no other mention of gz subdomain anywhere. No multisite, no sub folders on the server, nothing. gz.domainA only exist in Cloudflare DNS.

As a second test, I created a new random, subdomain on domainB. It does not redirect to sub domainC. Just sub.doaminA to domainC.

Does anyone have advice on how to track down where this mystery redirect might be located?

Thank you in advance.

Can you check your Page Rules for any redirects rules? You may have a rule that redirect *domainA.com/* to domainC.com. If that is the case, the first * is the problem since it would match with any subdomain of domainA.com at both HTTP and HTTPS.

Thank you Tanto259!

You’re talking about in Cloudflare Page Rules, right?

I don’t have any Page Rules redirecting. The only rule is .domainA.com/
to force https. This rule is in both domainA and domainC, each for its
specific domain.

Thank you again!

Since there’s nothing at the page rules, the 301 redirection may have come from the server itself. Please check your server for any 301 redirection in the form of .htaccess, WordPress plugins or even standalone PHP script.

did you ever figure this out, @nick1? I’m having a similar issue.

I have not. Cloud glare said the trace indicated it was on my server.
However, I can’t find any redirects on the server.

Let me see if I can get some fresh eyes on it, or at least a more detailed explanation.

Were you ever able to find any solution for this? I seem to be facing the exact same issue. As soon as I proxy my subdomain through Cloudflare it redirects to the domain. If I don’t proxy it, it resolved the subdomain correctly. Page rules are not interfering.