I would like to know how I can allow only certains domains to access my files, while redirect others with a 301, or angry man maybe .
Today I’m redirecting all users trying to access my /fonts of my “font server” (yannglt-type.netlify.com) folder with a 301, thanks to the netlify.toml file. But I need my main site (https://yannglt.com) to access the font files.
Do you have any idea ?
Rewrite Conditions seems to be a good one but I didn’t find anything in the docs that might help me…
Things are now fixed!
As you may see now on my website, things are now fixed! Hourra!
It was a bit complicated but here’s what I did, with developer friends of mine, using AWS buckets:
Create a bucket with my fonts files at the root (no “fonts” directory)
Allow public access for this bucket (private by default with AWS)
Change the bucket policy to only my desired domains
Add a CORS configuration for my bucket so Firefox and Chrome can call my font files (Safari seems to allow cross-origins resource sharing more easily…)