DNS for redirect

I’m having so much trouble with this redirect. I have a client who wants to point a domain to another website. i set up a cloudflare page-rule redirect and cancelled the hosting since they only needed the domain, but when the hosting expired the domain stopped pointing. I tried changing the cname records to a dummy IP and then i tried deleting all the cname records and putting in only the ones listed in the attached tutorial. anyone know what I’m doing wrong?

It’d be helpful to know the domains in question, as well as to see the page rule in question.

the domain that is pointing is lennygerard.net. I’m trying to have it point to lennygerard.com. I’ve attached a screenshot of the page rule.

It seems like lennygerard.net is not being proxied through Cloudflare. For a Page Rule to work, it needs to be.

$ host lennygerard.net
lennygerard.net has address

Also your page rule probably won’t fire for https://lennygerard.net because that doesn’t match *.lennygerard.net. Unclear what domains you’re actually trying to map, though.

Sorry, I’m still new to cloudflare. I think i fixed the proxy issue, but I’m not sure how to fix the page rule or what the

$ host lennygerard.net
lennygerard.net has address

is in reference to.

The host command tells me that you aren’t routed through Cloudflare because the IP address it is returning is, which is not a Cloudflare address. Cloudfare can’t run Page Rules on traffic that it isn’t getting.

The good news is that it appears you’ve fixed that and that the Page Rule is firing:

$ curl -D - -s -o /dev/null https://www.lennygerard.net/|grep location
location: http://lennygerard.com

As I mentioned earlier, this won’t work for https://lennygerard.net/; you will need to make a new Page Rule or update the existing rule to handle that, if you care about it.

how would i fix the page rule so that it works no regardless?

Your current rules seems to be “*.lennygerard.net/*”. This will match “anything.lennygerard.net/”, but will not match “lennygerard.net/” because there is no leading period. Makes sense? I would change it to “lennygerard.net/*”.

You could also match it to *lennygerard.net/*. Note that wildcard DNS records aren’t proxied, so while any specific first level subdomains you add may work, adding a wildcard one won’t work.

Okay, I think I got it fixed this time. Let me know if anything looks wrong to you. thanks again for all your help.

Quick suggestion, not wrong per se, but useless double redirect.

Since the other domain goes automatically to https://www.lennygerard.com, put that as the forwarding target.

Thank you! Appreciate the help. By the way, I really want to understand this better so if there are any other threads or tutorials or anything that can help explain this to me so I can get it right the first time in the future, please feel free to share :upside_down_face:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.