Medium .htaccess protection

From D3xt3r01.tk
Revision as of 14:21, 4 August 2013 by Admin (talk | contribs) (Created page with "==WHY== Because I wanted to give some access to sime files based on some stuff .. ==HOW== This will allow users with the user-agents starting with "Thing", "Some" and "Bro...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

WHY

Because I wanted to give some access to sime files based on some stuff ..

HOW

This will allow users with the user-agents starting with "Thing", "Some" and "Browser" to directly access files with extensions ".ex3", ".ex2" and ".ex1" without needing a password... it's useful for example on tablets where the players don't/can't auth...

AuthType Basic
AuthName "Restricted Files"
AuthUserFile /path/to/.passwords
AuthGroupFile /path/to/.groups
SetEnvIf User-Agent ^Thing isplayer=1
SetEnvIf User-Agent ^Some isplayer=1
SetEnvIf User-Agent ^Browser isplayer=1
SetEnvIf Request_URI "\.ex3$" isfile=1
SetEnvIf Request_URI "\.ex2$" isfile=1
SetEnvIf Request_URI "\.ex1$" isfile=1
<RequireAny>
    Require group onegroup anothergroup
    <RequireAll>
        Require env isfile
        Require env isplayer
    </RequireAll>
</RequireAny