I have exactly the same problem treated in this topic. That's: I have some static files in some folders and I want only some users to see that content. That users are coming from a previous login.
To get that, I'm trying to implement the first solution given in this topic, that's:
Create the following .htaccess file under "static-files":
Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)$ ../authorize.php?file=$1 [NC]
And then in authorize.php...
if (isLoggedInUser()) readfile('static-files/'.$_REQUEST['file']); else echo 'denied';
This authorize.php file is grossly over simplified, but you get the idea.kquote
So, redirect any request to the authorize.php file, who check if the user is logged in and, if so, serve the content.
That's working perfectly with html, js and images... but I don't know why css styles are not showed. It's strange, because I can access that css files directly with my browser, but when they are called from the html it's not working. Of course, if I try to work without the authorize.php styles are showed as usual.
What am I missing out?
Thank you,