Twitter Cards are broken on aftershock.news


#1

Hi,

when we check twitter cards wuith ‘validation’ tool, everything seems good:

  1. Original article - https://aftershock.news/?q=node/480033
  2. Twitter validation screen -
  3. But it does not work when we twit the arrticle:

So, the question is - how comes and what to do to fix that?

thanks!
AfterShock team.


#2

I don’t see any of your URLs working in the validator, there’s a message about being denied by the robots.txt file. See https://aftershock.news/robots.txt which is blocking all crawlers including Twitterbot from accessing the pages.


#3

Did you check the url which I provided above? It works finely in validator. Note also sometimes validator fails on first attempt, and works finely on next try.

Regarding robots.txt. The file had been changed few days ago, but all the stuff needed for Twitter bot is allowed.

Hmm… Is it possible the bot uses some cached version of robots.txt? How long does is cache duration then?


#4

Ah! I see what is happening here.

When you validate the URL, you have https://aftershock.news/?q=node/480033 but when you Tweet it, the URL you’ve posted is https://aftershock.news/?q=node%2F480033 (i.e. the / is encoded to %2F). This causes the matching of the robots.txt rules to change - I was validating with %2F and the robots.txt file prevents that from working, but switching to / it works.

You can either ensure that you post the URLs correctly containing /, or you can update your robots.txt rules to prevent %2F from causing an error like this.

Your cards are working fine.


#5

Very good point. Indeed, the encoding is different.
Now we’ve changed robots.txt and it looks like that path is allowed via robots.txt checking tool.
But twitter validator complaints. Cache?
Is it possible to reload robots.txt manually or somehow?

thanks!


#6

It seems to be working for me in the validator with and without the / encoding now, so hopefully anything you saw was only temporary.


#7

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.