We have a website at https://optimistic-lamarr-a5fb39.netlify.app (also visible via our domain https://spaceprob.es ) that contains statically-rendered Twitter card metadata in the HTML in the usual way. Our Twitter cards work great with the Twitter Card validator and on Twitter itself.
Our site also has the automatic Netlify-generated redirect from all HTTP URLs to their HTTPS equivalents. When Twitter users hand-write the URL and end up with the http version, the Twitter cards do not display.
When we check a URL such as Voyager 1 (one that works with Twitter on HTTPS) using the Twitter validator we get the error: “INFO: Page fetched successfully … WARN: No metatags found”
When I hit the HTTP URL using Curl (with or without the Twitterbot agent) then the redirect looks fine to me. It’s a regular 301 HTTP response with a Location header.
I shared these malfunctioning URLs with Twitter support and they told me the following:
“So when I curl it I do indeed see a 301 and then get the response back on the redirect. And it works from the command line with the Twitterbot user-agent. But when I run it internally the crawler is seeing an “OK” status, with a statuscode of 400. It gets the content, but because the statuscode is 400, it ignores it. I am not sure why that would be happening. Something in Netlify config? I cannot explain it.”
Can you help me diagnose this 400 error that the Twitterbot appears to provoke from your builtin HTTPS redirects?