Redirection (Page Rule) does not work

Hello,

I have tried both:

Rules / Redirect Rules

  • Create Rule
  • Rule name: Redirection
  • All incoming requests
  • Type: Static
  • URL: https://www.example2.com
  • Status Code: 301
  • Deploy

Rules / Page Rules

Neither of both works.

I honestly don’t know what to do, as I have registered these domains with cloudflare,
but only want to redirect the traffic to another URL (my twitter account).

I tried one for a couple of days, than the other one.

Can someone tell me what I do wrong?

Btw, I have no DNS credentials whatoever.
(only the default Cloudflare Nameservers, which I cannot change).

You need to have a DNS record for the domain/subdomain you are redirecting from so the request resolves and goes to Cloudlfare.

Add a proxied dummy DNS record for www as A 192.0.2.1 or AAAA 100:: as you are only redirecting.

If that doesn’t work, can you give the domain name and show a screenshot of your rules.

2 Likes

Ok, I have done so (added DNS).

Until now, nothing has changed.

Maybe it needs some time to progress, I don’t know.

What is the domain?

1 Like

Now I have a 522: Connection timed out error.

Has to do with the DNS ( proxied dummy DNS record for www as A 192.0.2.1)?!

Truly does not add up.

The domain is cheatsgpt.com

There’s no DNS record for www.cheatsgpt.com (the one you are doing the redirect rule for and should have entered the dummy DNS record for)
https://cf.sjr.org.uk/tools/check?7913f803e4684ed5b66139568fc9f29a#dns

There is a DNS record for cheatsgpt.com (this one you are not redirecting and is giving the 522 error).
https://cf.sjr.org.uk/tools/check?31a2066a451e450694db47046c01c348#connection-server-https

Can you show a screenshot of your Cloudflare DNS records?

2 Likes

Here is the screenshot:

So yeah, www. works, without not.

Edit: ok, got it.

Created 2nd page rule for without www.

Huge Thanks!

I honestly didn’t know that you need to create a DNS dummy for that.

And I think this is nowhere mentioned in the docs / forum …

Now you’ve added the www record it resolves.

If you want to redirect both apex and www, then set the page rule URL to *cheatsgpt.com/*

The redirect is now working…
https://cf.sjr.org.uk/tools/check?4e7ea5220ca0479e944af34241490f37#connection-server-https

2 Likes

Alright, with

*cheatsgpt.com/*

I only need one page rule, right?..

Thanks again. :slightly_smiling_face: :+1:

Yes, that one rule will cover the apex domain and any subdomains. If you have other subdomains that you don’t want redirected, then you’ll need to have a rule for each of the apex domain and www so only those are redirected.

2 Likes