Pointing sub domain to non-primary main domain

What is the name of the domain?

domain.com

What is the issue you’re encountering

Trying to point a subdomain to a primary domain on a development server

What are the steps to reproduce the issue?

Currently have the primary domain (domain-com) pointing to the server IP 1.2.3.4. Have a development server that also has the primary domain (domain-com) that is on server IP 2.3.4.5. I’m trying to create a subdomain in cloudflare (test-domain-com) that points to the primary domain on the test server (IP 2.3.4.5). Is this doable? Or does the development server have to have the subdomain (test-domain-com) setup?

May I ask would you like to use test.domain.com which would load content from development domain.com, like rewrite URl or rather redirect everything from test.domain.com to domain.com (might need to update domain.com)? :thinking:

Add a new DNS record A test pointed to the temporary IP like 192.0.2.1 and proxied :orange: . Create a Redirect Rule as follows:

What kind of content would you serve from the test sub-domain? Usually, yes.

Thanks for the feedback. Maybe to simplify my question, is it possible to point a subdomain (ie: test.domain.com) to a primary domain account within cPanel (ie: domain.com) - or does the cPanel account have to be test.domain.com?

Hello,

To further investigate this issue, could you kindly verify your domain ?

Thank you !

Do you mean that you would like requests to test.domain.com to be sent to your origin with a Host header domain.com so that you won’t need to configure it to accept requests for test.domain.com explicitly?

If so, then Origin Rules allow you to rewrite Host headers on the Enterprise plan. Alternatively, you can use Snippets to achieve the same transformation using JavaScript code.