Forum Moderators: phranque

Message Too Old, No Replies

SetEnvIf syntax?

         

keyplyr

7:33 am on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I temporarily ban problem users for a period of time by the "SetEnvIf" method so I can watch their subsequent requests via error_log and make a determination whether to ban permanently.

I wish to serve a particular banned user my custom 403 including CSS, scripting and audio message. I know I need to allow all these files, but do I write an "allowit" for each or is there a condensed method? Thanks.


SetEnvIf Remote_Addr ^***\.***\.***\.*$ ban
SetEnvIf Request_URI ^/custom403\.html$ allowit
SetEnvIf Request_URI ^/css/sheet\.css$ allowit
SetEnvIf Request_URI ^/scripts/javascript\.js$ allowit
SetEnvIf Request_URI ^/audio/scram\.wav$ allowit
<Files *>
Order Deny,Allow
Deny from env=ban
Allow from env=allowit
</Files>

jdMorgan

7:09 pm on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



keyplyr,

The simplest way would be to change the second line of your code to:


SetEnvIf Request_URI ^/(custom403\.html¦css_file\.css¦getout\.wav)$ allowit

Remember to fix the broken pipes!

Jim

keyplyr

7:19 pm on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I had considered doing just that Jim, however I was unsure because the files reside in different directories. Thanks.

keyplyr

11:25 pm on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<update>

Actually, that did not work until I added those directories back, example:


^/(custom403\.html¦css/sheet\.css¦scripts/javascript\.js¦audio/scram\.wav)$