donniebrandt's avatar

Root domain redirects to test subdomain

Problem:

www.domain.com is automatically redirecting to test.domain.com.

Context:

I have used Forge to set up a web server at DigitalOcean. This server has two sites on it:

  • domain.com which is fully configured, but always defers to test.
  • test.domain.com which is fully configured and working.

I have the domain routed through Cloudflare and have two A records configured:

  • A | domain.com | ip_address
  • A | test | ip_address

Why does domain.com not load? The code, environment, and data are all correct.

(Also, if I point domain.com to a different IP address, it's fine.)

0 likes
3 replies
Snapey's avatar

apache or nginx?

I know with apache if there is a problem with your virtualHost config it seems to just show the first available website

donniebrandt's avatar
donniebrandt
OP
Best Answer
Level 4

Although not 100% sure since I was trying several things at once, it appears the issue was that I did not have SSL installed on the root domain while it was installed on test. Hence, the redirect (?).

Please or to participate in this conversation.