Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 使用.htaccess,阻止用户访问目录中的图像_Html_.htaccess - Fatal编程技术网

Html 使用.htaccess,阻止用户访问目录中的图像

Html 使用.htaccess,阻止用户访问目录中的图像,html,.htaccess,Html,.htaccess,我试着用这个: Options -Indexes 它适用于文件夹,但如果您这样写特定的图像名称 www.example.com/images/pictures.jpg 您仍然可以查看图像,是否仍有禁用该图像的功能 我也试着用这个做同样的事情 IndexIgnore * 希望这有帮助 RewriteEngine on RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com[NC] RewriteCond %{HTTP_REFERE

我试着用这个:

Options -Indexes
它适用于文件夹,但如果您这样写特定的图像名称

www.example.com/images/pictures.jpg
您仍然可以查看图像,是否仍有禁用该图像的功能

我也试着用这个做同样的事情

IndexIgnore *
希望这有帮助

RewriteEngine on 
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com[NC] 
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com.*$ [NC] 
RewriteRule \.(gif|jpg)$ - [F]
原来的答案在这里;