Greetings.
Actually, I need either advice in the internet, for which I don’t have enough mind to google (I don’t know these words), or an explanation, preferably with code, how to implement the following:
We have - on the hosting 2 files, '.htaccess' and, in the folder with it, 'get rich.pdf'. The user can be both authorized and unauthorized on the site. And maybe in the address of the site to drive this file (get rich.pdf).
Is it possible, when accessing a file, to configure '.htaccess' so that it is thrown to a specific php file to which the file address was transferred (get rich.pdf, go bankrupt.pdf, happiness.pdf, ..) file was file access to the hosting or not.
PS Yes, I was already looking for this. I’m going out only to lectures on what authorization is, what PHP is, and how to temporarily upload a file to a specific directory with a complex name (unfortunately, I haven’t seen a real example).
//.htaccess чудо проверка через chudo.php //chudo.php if($autorized==true){ как то разрешить показать файл }else{ показать картинку с печальным котом }