Forum Moderators: phranque

Message Too Old, No Replies

Access/Directive Order Priorities within .htaccess

         

Tat4Life

8:57 am on Jan 26, 2005 (gmt 0)

10+ Year Member



Hi All,
glad to be on this board. I learned so much its fun reading my error logs. Anyway, I redid my .htaccess file and I'm little perplexed about the access/directive order priorities. Why...I have IPs and a range of IPs I want to ban and I want to get my priorites straight, no pun intended :-) before I list the IPs, My .htaccess is below:

Scenario: I have a trap implemented and hotlinking countermeasures.

<----------The start .htaccess page--------------->
# -FrontPage-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*

SetEnvIfNoCase User-Agent EmailSiphon AC_FORBIDDEN
<-----shorten for brevity---->

SetEnvIf Request_URI "^(/403.*\.html¦/robots\.txt¦/403\.html)$" allowsome

<Files *>
order deny,allow
deny from env=getout
allow from env=allowsome
</Files>

RedirectMatch my_bobby_trap_file\.html [mydomain.com...]

<Limit GET POST>
order deny,allow
deny from env=AC_FORBIDDEN
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

ErrorDocument 404 /404.html
ErrorDocument 403 /403.html

RewriteEngine On
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mydomain.com [NC]
RewriteRule \.(gif¦jpe?g)$ /thief.$1 [F,L]

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^Ants [NC,OR]
<---------shorten for brevity---------->
<----------The end.htaccess page--------------->

I'm not an expert, just learned a great deal from here. I just need help on access/directive priorities.

Thanks in advance

jdMorgan

11:20 pm on Jan 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have never been able to get an .htaccess file to work with nore than one "Order" directive in it, so I suggest you combine all these into one comprehensive routine, using one Order directive.

The reply I posted to your previous thread may serve as an example.

Jim

Tat4Life

1:17 am on Jan 27, 2005 (gmt 0)

10+ Year Member



Jim,

You answered both questions. I thought so, I guess having many suggestions to simple questions can be confusing :-)) I appreciate the solutions and will get working on them.