Block direct access to an image but leave it visible on the site

Right now, the image is visible on the page but trying to access it with no Referer header fails with a 403 error. Isn’t that what you’re trying to accomplish? It’s working.

Be aware that legitimate browser access within the context of the page won’t always have a Referer header, so you will be blocking some legitimate views of the image by doing this. And that anyone can manually retrieve your image directly by simply adding a Referer header.

% curl -H 'Referer: https://mangas-origines.fr/' -I https://mangas-origines.fr/wp-content/uploads/WP-manga/data/manga_6335704bc33d7/4e1c94e81a40a33d98468e4db4a019b9/page_0.jpg
HTTP/2 200
[...]
1 Like