T
T
temakorolev12020-10-26 01:16:47
PHP
temakorolev1, 2020-10-26 01:16:47

How to prohibit access (archive download) by url?

I rummaged through Google, took a lot of examples, it didn’t help (Even some authors of the posts themselves didn’t help, judging by the comments, or I’m doing something wrong). This means that there is a docs.zip archive in the site directory. If you follow the link domain/docs.zip, the archive is automatically downloaded. But I would like to disable it. I saw it was written on one of the sites - to place the archive outside the site directories, but the question is, how then to issue this file to certain users?
For example, I tried to use this code in .htaccess:
< Files "docs.zip" >
deny from all
</ Files >
As a result, there is no result

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Shamanov, 2020-10-26
@SilenceOfWinter

<FilesMatch regex>
    Deny from all
</FilesMatch>

<Files regex>
  Order Deny,Allow
  Deny From All
</Files>

F
FanatPHP, 2020-10-26
@FanatPHP

How to prohibit access (archive download) by url?

place the archive outside the site directories
how then to issue this file to certain users?

and this is another question, which has nothing to do with the first.
Learn to ask questions so you get good answers.
Your current question has been answered.

V
Viktor Taran, 2020-10-26
@shambler81

полодите архив под .htpass и скачивате его с урлом указав пароль, в таком случае физически файл не возможно будет скачать только со ссылкой логина и пароля.
это самое простое решение.
Второе решение это скачивание файла через php генерацию урла.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question