我正在使用 codeigniter 构建一个包含大量图片库的网站,我将图片存储在文件夹中,但我想限制通过 url 访问文件夹。即我不希望人们使用 url 访问我的图片文件夹像这样::
所有图像都是包含图像文件夹的文件夹..我尝试使用htaccess
文件
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^CI_system.*
RewriteRule ^(.*)$ /website/index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|all_images)
RewriteRule ^(.*)$ /website/index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
index.php 的重写条件运行良好,但我仍然可以通过 url 访问我的所有文件夹