How can I hide the contents of a directory without an index file from being displayed to the user i.e show "Index of:" ? For example, I have a folder called /documents with alot of subdirectories now inside of the subdirectories there will be files stored for example test.pdf. The full URL will look as follows www.example.com/documents/874256987/test.pdf. Currently if the user types www.example.com/documents into the url, all of the subdirectories are displayed, this is what I want to avoid. Only if the user knows the full url for example www.example.com/documents/874258726/test.pdf, the user is able to open the document in the browser. I have tried "IndexIgnore" inside of a .htaccess file, but the problem is even if the user knows the full url he/she will get 403 Forbidden.
1条回答 默认 最新
- doujiyan0971 2018-05-12 10:56关注
I have fixed the issue by changing "Options Indexes FollowSymLinks MultiViews" to "Options FollowSymLinks MultiViews" inside of my conf file in /etc/apache2/sites-available. Removing "Indexes" did the trick. Now when someone types in www.example.com/documents they get 403 error, but providing the full path www.example.com/documents/850752485/test.pdf the file is displayed in the browser.
解决 无用评论 打赏 举报
悬赏问题
- ¥15 使用EMD去噪处理RML2016数据集时候的原理
- ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
- ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
- ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
- ¥15 如何在炒股软件中,爬到我想看的日k线
- ¥15 seatunnel 怎么配置Elasticsearch
- ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
- ¥15 (标签-MATLAB|关键词-多址)
- ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
- ¥500 52810做蓝牙接受端