The first idea that comes to mind will be installation Cookiewhen the user authenticates to check it in Apache using mod_rewrite.
Not sure if this works for you though ...
Let me know if you need an example RewriteRule.
EDIT - example rule:
Assuming that the static content is in the directory /static/, the following should result 401 Forbiddenif the user is not logged in (as a result, the cookie matters authenticated=true)
RewriteEngine on
RewriteCond %{REQUEST_URI} ^\/static\/
RewriteCond %{HTTP_COOKIE} !authenticated=true
RewriteRule .* - [L,F]
I used this method to direct mobile traffic, but not to limit protected content, so I would recommend a thorough test.
Hope this helps.
source
share