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.
Tried a wildcard redirect, per Cloudflare’s docs. HTTP redirects work as expect, HTTPS does not. URL forwarding | Page Rules
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.
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?
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() A record with the dummy IP address 192.0.2.1.
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.
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
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.