Welcome to WebmasterWorld Guest from 3.80.6.254

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Prevent Site Ripping

Best Methods (order, location etc)

     
12:28 pm on Jan 6, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 6, 2001
posts:2213
votes: 0


Reading parts of the the "Close to perfect list"
[webmasterworld.com...]

Maybe it is in there but I cant seem to find it, with the size of the thread.

Clearly using htaccess the rules must be read each and every time a page is read so it sounds like a the rules could be put into the httpd but the order.

Where does one need to put the the rules, before other existing rules of after them It strikes me that before would be better but I am not sure.

eg
#===========
rules for error pages
rules for maing pages static looking
rules for preventing hotlinking
rules for ban list
#================

Is there a default order to the list?

Cheers

2:34 am on Jan 7, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


> each and every time a page is read

Each and every time a resource - page, script, image, CSS file, etc. - is requested, actually -- regardless of whether the code is in httpd.conf or .htaccess.

The advantage of httpd.conf over .htaccess is that code in httpd.conf is compiled at startup, versus code in .htaccess being interpreted on-the-fly at the time that a request arrives.

As to order... If you have a real problem with certain IPs or certain user-agents hotlinking, putting the code to block those first will save you a little server CPU time. However, successful requests will usually have to pass through the entire block of code, since 'good guys' will be allowed access only after all of your tests to see if they are in fact good. Therefore, the only gain is to kick frequent abusers out at the earliest opportunity.

However, if you can't pinpoint a type of problem that occurs very frequently, then there is no basis upon which to establish order except for ease of documentation and maintenance.

About the only thing I can tell you is that in .htaccess, mod_access directives are processed before mod_rewrite directives, regardless of their position in your code -- each module reads and interprets the code looking for directives it can handle, so you do not really control the exact order of execution by position in your file.

I hope this description makes sense!

Jim

3:18 am on Jan 7, 2004 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Mar 31, 2002
posts:7577
votes: 4


Gracia jdMorgan - that answers a question I've been hanging onto. :)
10:17 am on Jan 7, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 6, 2001
posts:2213
votes: 0


thanks jdM'

Most useful :)