I have a website where the photos are using a Backblaze bucket accessed via CNAME:
i.example.com/myphoto.jpg
Because Workers aren’t allowed on CNAMEs (outside Business/Enterprise accounts), I am currently redirecting incoming links like this to run a Worker:
img.example.com/myphoto.jpg
→ Page Rule redirect → i.example.com/myphoto.jpg
However, if a user accesses i.example.com/myphoto.jpg
directly they bypass the Worker. I’d like my users to hit the Worker domain before seeing the photo(s). Is there a way to block direct access to i.example.com/*
unless they hit the Worker domain first?
I tried a Firewall rule blocking i.example.com
unless img.example.com
was the referrer. But this didn’t work and just blocked i.example.com
access even after the redirect.