Forums

Facebook and social media cannot access static files (robots.txt, preview image) for preview

Hello PythonAnywhere Support,

My username is fmogini and my site is alternativescales.com (paid account).

The site is accessible from my browser and for other users, but when sharing the link on Facebook or other social media, the preview image does not appear. Using the Facebook Sharing Debugger, I see a 403 or timeout error when Facebook tries to access static files like robots.txt and /static/preview.png.

My static file mappings are:

/static/ → /home/fmogini/alternativescales/static/
robots.txt → /home/fmogini/alternativescales/robots.txt

I have reloaded my web app after making these changes, and the files are in the correct locations.

Could you please check if there are any restrictions or blocks that would prevent Facebook’s crawler (facebookexternalhit) or other social media bots from accessing my static files?

Thank you for your help!

[formatted by admin]

Looks like /static/ is behaving correctly (I was able to reach /static/preview.png). Regarding robots.txt, try prepending / to the url in static files mapping section, so instead of bare robots.txt, use /robots.txt.

thank you ! I have changed to : /robots.txt but it still does not work, maybe a hosting issue.

It is working for me (it loads a 2 line txt file with User-agent and Allow rows).