Domain Redirection Failed - Connection timed out Error code 522

I want to add following redirect according to this tutorial
https://webguided.com/redirect-domain-cloudflare/

Domain Redirection
atypiquevoyages.com ==> atypiquevoyages.fr

Then, I added following A Records

Finally I added Page rule
Screenshot : https://prnt.sc/e27rPbUL397d

Here is the result
Screenshot : https://prnt.sc/X9c9MJ5hEuWJ

It’s working:

% curl -svo /dev/null https://atypiquevoyages.com/test 2>&1 | egrep "< HTTP|location"
< HTTP/2 301 
< location: https://atypiquevoyages.fr

You can also check with this tool:
https://www.redirect-checker.org/

3 Likes

Thanks ! it works ! but

https://atypiquevoyages.com/ - NOT OK

It gives “Connection timed out Error code 522” Error

https://www.atypiquevoyages.com/ - OK

That’s weird. I thought I tried that one, as well. If you have some other Page Rule above that, and matches, that would prevent the redirect.

Redirect Rules will do the same thing. Use contains to redirect all .com hostnames to .fr, or use is in to make a list of specific hostnames:

1 Like

https://atypiquevoyages.com/ - NOT WORK
Connection timed out Error code 522

http://atypiquevoyages.com/ - WORKS

Can you share a screenshot of your redirect rule?

1 Like

@DarkDeviL Here it is.

@sameera

Both do not work. You may be probably seeing the cached page. As of now, your site is experiencing connection timeout error. Make sure to check this CommunityTip for the resolution:

That redirect rule will redirect from http(s)://www.atypiquevoyages.com to https://atypiquevoyages.fr, and that one is actually working as it should, according to the current set up:

$ curl -s -D - -o /dev/null http://www.atypiquevoyages.com
HTTP/1.1 301 Moved Permanently
Location: https://atypiquevoyages.fr

$ curl -s -D - -o /dev/null https://www.atypiquevoyages.com
HTTP/2 301
location: https://atypiquevoyages.fr

Your current redirect rule will however only cover redirects FROM http(s)://www.atypiquevoyages.com, as you include the “www.” part in the URL (required) field.

If you also want http(s)://atypiquevoyages.com (without www) to be redirecting, one option would be to change that URL (required) field to become something like:

*atypiquevoyages.com/*

Changing that URL (required) field MAY however interfere with some of the records you have for Office 365, as it would be redirecting all Proxied (:orange:) records, where the actual URL contains “atypiquevoyages.com/”.

Alternative would be using Redirect Rules (rather than Page Rules), which would offer much more granularity:

→ https://dash.cloudflare.com/?to=/:account/:zone/rules/redirect-rules

No matter which way you go, I would say that the five CNAME records you have, that are actually pointing to an external provider, should have their Proxy status changed, to become Unproxied (:grey:) / DNS-only instead.

2 Likes