I hope my question is clear:
I have already seen images uploaded by Amazon CloudFront that have their "differentiated" URL for images and blocks all subfolders of the path if the user tries to access. I explain.
URL displaying the image: dyqnik0vds4aw.cloudfront.net/uploads/blog/imagem/900/imagem.jpg
If we remove the image.jpg , for example, it displays the following message:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>0A1B7A4F06A544B7</RequestId>
<HostId>
HAvQCyWqXGr6xFPOA4IIZPWudC+TSxyBnjQyMitrHu5cQ9eBk6zbFrHWY82xvMVREzYbnWCtU5g=
</HostId>
</Error>
That is, if the user tries to access any other subfolder of the image path it is blocked.
However, I'm using WordPress to create a website, when an image is uploaded by default, it has the URL site.com/wp-content/uploads/2018/02/imagem.png
. If the user exits /2018/02/imagem.png
(in this case, accessing site.com/wp-content/uploads/ ) the INDEX OF page appears and you can access some folders, what you would like to avoid if possible.
Anyway, I wonder if I can block / hide the image path the way Amazon CloudFront blocks your links.
----------------------- *edited* -------------------------------
After a while playing with websites and seeing several things here in SOPT, in the opera summary, what I want is to create a 403 forbidden
page which, in addition to blocking the WordPress folders, is a custom page.
I think it would only increase the response of @Almeida below.