HTTPS Redirect Rule Not Working

What is the name of the domain?

example.com

What is the issue you’re encountering

HTTPS Requests are not getting redirected to external domain

What steps have you taken to resolve the issue?

Expectation: HTTPS requests to https://example.com to redirect to https://redirect.com.

example.com does not have anything hosted behind it, the domain exists for convenience since redirect.com is in reality a much more complicated domain and more difficult for consumers to type in and get to.

  1. Tried a wildcard redirect, per Cloudflare’s docs. HTTP redirects work as expect, HTTPS does not. URL forwarding | Page Rules
  2. Tried turning off HTTPS, and then adding a static redirect rule for HTTPS traffic to go to HTTP, which would then redirect. HTTPS still not working.
  3. Tried isolating HTTPS-only traffic with a rule https://*.example.com/* to redirect to https://redirect.com. Did not work either.

I will get a timeout error or a DNS resolution error every time for each of these things I’ve tried.

DNS Records look like:
Type: CNAME
Name: www
Content: example.com
Proxy Status: Proxied

What feature, service or problem is this related to?

DNS not responding/updating

How about example.com itself? Do you have a DNS record for it?

The hostname needs to be proxied on the Cloudflare network before the redirect engine can kick in. Since this is merely for redirection, create a proxied(:orange:) A record with the dummy IP address 192.0.2.1.

1 Like

Thanks for the response! Good call, I added the dummy IP but still running into issues. On the HTTPS request, I’m now getting a 522 connection timeout from Cloudflare so that’s an improvement.

Please follow the step-by-step guide below to create a Redirect Rule to forward the domain:

If you’ve done this already and it’s not working, please share a screenshot of your rule page here so we can take a look for you.

Standing by.

2 Likes

Hey George,

Thanks again for the help! Here is the redirect that I have in place that is causing the 522 error when attempting to hit the apex https URL to then redirect (https://example.com with no www).

For completeness, the DNS records are below(formatting for the URL is off intentionally because I’m prevented from having multiple links in my response):
A | example . com | 192.0.2.1 | proxied|
CNAME | www | example . com | proxied

This is the redirect rule:

I’m being prevented from uploading more screenshots, but the target URL for this redirect is a static URL with a 301 status code preserving the query string.

Then I’m getting a 522 error in the browser, which is a Cloudflare error page saying the (a) Browser is working, (b) Cloudflare is working, but (c) the Host had an error.

*.example.com will only match subdomains of example.com, not the root domain.

2 Likes