Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
使用.htaccess保护特定目录_.htaccess_Access Control - Fatal编程技术网

使用.htaccess保护特定目录

使用.htaccess保护特定目录,.htaccess,access-control,.htaccess,Access Control,是否可以使用单个.htaccess和.htpasswd文件保护特定目录 我只能在seam中找到保护单个文件或整个目录(及其子目录)的功能 例如/public\u html/myfolder中的htpasswd 保护 /public_html/myfolder/secret /public\u html/myfolder/admin 但不是 /public\u html/myfolder/mypublicfileshtaccess文件是每个目录的选项,它有点像块,但由放置htaccess文件的位置

是否可以使用单个.htaccess和.htpasswd文件保护特定目录

我只能在seam中找到保护单个文件或整个目录(及其子目录)的功能

例如/public\u html/myfolder中的htpasswd

保护

/public_html/myfolder/secret
/public\u html/myfolder/admin

但不是


/public\u html/myfolder/mypublicfiles

htaccess文件是每个目录的选项,它有点像
块,但由放置htaccess文件的位置定义。因此,您不能在htaccess文件所在的目录之外的目录上任意设置HTTP身份验证