Home > Programming, Servers & Scripts >

CNAME & CloudFlare? --- PLEASE HELP! (4)


04-10-2014 03:52 PM #1 tono (Member)
CNAME & CloudFlare? --- PLEASE HELP!

Hey guys,

This issue has put all my campaigns at a complete halt for the past 2 days. I haven't be able to get the help/answer I need from neither Cloudflare or my hosting provider.

For the sake of the example,

domain-cf.com - is set up on CF and also contains all of the files for my site.
domain-2.com - is still under godaddy's name servers / also tried hosting it on Cloudflare

Want: domain-cf.com/sample.html => domain-2.com/sample.html

That's it.

I use CNAME's all the time without any issues, but for some reason (first time using CF) I can't get it to work. Not not a technical dude, nor am I all that familiar with Cloudflare, but for the past two days I've try almost everything. Not sure if I'm making much sense here.

Please help!


04-11-2014 01:25 AM #2 zeno (Administrator)

1. Are you using SSL? If you are, this becomes more complicated. If not, this should work:

Host domain-2.com with cloudflare. As it is, domain-2.com/sample.html should then load through Cloudflare and via your server. Make sure that works first.

Then, take domain-cf.com and have it's nameservers set to something like Rackspace Cloud DNS, Route 53, whatever you want. You could use GoDaddy's nameservers, it really doesn't matter as long as you can change the DNS info like CNAMEs.

Set the domain-cf.com to CNAME to domain-2.com

Loading domain-cf.com should now propagate to domain-2.com which then loads your site via CloudFlare.

The problem may simply be that you have it backwards - the CloudFlare domain should be at the end of the hops since it communicates with your server directly.


04-11-2014 02:22 AM #3 tono (Member)

Quote Originally Posted by zeno View Post
1. Are you using SSL? If you are, this becomes more complicated. If not, this should work:

Host domain-2.com with cloudflare. As it is, domain-2.com/sample.html should then load through Cloudflare and via your server. Make sure that works first.

Then, take domain-cf.com and have it's nameservers set to something like Rackspace Cloud DNS, Route 53, whatever you want. You could use GoDaddy's nameservers, it really doesn't matter as long as you can change the DNS info like CNAMEs.

Set the domain-cf.com to CNAME to domain-2.com

Loading domain-cf.com should now propagate to domain-2.com which then loads your site via CloudFlare.

The problem may simply be that you have it backwards - the CloudFlare domain should be at the end of the hops since it communicates with your server directly.
I don't have any files with Domain-2.com. Domain-CF.com is on cloudfront and also houses all the files.
I want to load domain-2.com to show domain-cf.com

Aside from that, I did try what you were saying earlier today but I would receive a 404-error message from cPanel when I would try to access a page through domain-2.com


04-11-2014 03:26 AM #4 zeno (Administrator)

Right, so have domain-2.com point to domain-cf.com via a CNAME. Then have domain-cf.com hosted at CF and pointing to your server IP.

On your server, you will need to make sure a virtual host/site is setup for domain-2.com - the browser will tell the server what site it is after (irrelevant of background DNS resolution) and if there is no domain-2.com set up then the server will respond with a 404 most likely, or a forbidden, etc.


Home > Programming, Servers & Scripts >