A
A
abdulah2014-08-29 14:15:09
PHP
abdulah, 2014-08-29 14:15:09

How to disable direct link access to hosted files for unauthorized users?

Good afternoon, how to disable access to files via a direct link?
for example, here is the link: glamourpress.ru/wp-content/uploads/2012/09/baby.jpg clicking
on this link opens a photo.
Is it possible to make photos visible only to authorized users?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
KorsaR-ZN, 2014-08-29
@KorsaR-ZN

This can be done only by starting the processing of such links to a php file that will check authorization and make a decision to let it go or not.
But how to then give the file to the client, if he is authorized, is a separate story, and additional information is needed to answer it.
Do you have access to the server settings?,
Is there a module on apache xsendfile or is it possible to install it?
Is nginx worth it or is it possible to install it?
If there are no answers to all the questions, then you need to give the file using PHP, which is not very effective, but also normal :)

V
Vlad Zhivotnev, 2014-08-29
@inkvizitor68sl

What about software?
In nginx, you can check the cookie and the referrer, if there is no cookie or referrer, send it to the forest.

T
Timur Sergeevich, 2014-08-29
@MyAlesya

If you give files to php itself, for example, then you can.

V
Valentine, 2014-08-29
@vvpoloskin

X-acel-redirect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question