Yii2. Restrict access to images folder -
i show example of achieve. , curious how implement in yii2
.
there website http://www.hleda-se-phpkar.cz/
. if inspect
top main image see:
<img src="images/leader.png" alt="">
if write instantly address
line:
http://www.hleda-se-phpkar.cz/images/leader.png
i see picture leader.png
in browser
.
but if write:
http://www.hleda-se-phpkar.cz/images
i see:
forbidden don't have permission access /images/ on server.
so how restrict access folder
images described above?
for mentioned restriction type , apache server need create .htaccess
file inside folder
, add line
options -indexes
and hit enter. doesn't allow files listing still allows files access. no special action yii 2 necessary.
Comments
Post a Comment