I have a Raspberry Pi 4, running as a webserver (using Apache2). I have a directory that contains images, and I don't want users to access the folder that contains those images via my website, but I want those images still accessible via links. Any ideas?
If you want to disable the automatic generation of the directory listing (by mod_autoindex, if an index.html
is missing in the directory), you can disable this feature for your image directory in your Apache config:
<Directory /var/www/html/images>
Options -Indexes
</Directory>
The files inside the directory will still be accessible via links, image tags, etc., it only forbids the directory listing.
Related:
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加