I have one main domain name - a***.*** - and one addon domain name - m***.*** (please don't post publicly my domain names). In the main domain name root folder, I use .php file to redirect to the main directory of my website by using: header("Location: https://a***.***/folder-name/index.php"); The problem is, that when I visit my main domain name(a***.***), I'm getting first the 521 error message and only then the redirection. I'm seeing the 521 error message in browser's history window, with the logged title of the page: a***.*** | 521: Web server is down and then on a new logged line, my https://a***.***/folder-name/index.php file, with the normal title. Can't figure out what may cause this to happen. UPDATE: Apparently Cloudflare uses 521 error, but yet not sure why is this triggered