Config .htaccess for Referrer and Agent of ET only?

Discussion for Admins of ETPro/BayonET servers.
If you don't run a server, please don't post here...

Moderators: Forum moderators, developers

mike
Posts: 27
Joined: Thu Mar 17, 2005 8:09 am
Location: Germany
Contact:

Config .htaccess for Referrer and Agent of ET only?

Post by mike »

Hi

has someone a fully functional config for apache2 .htaccess which blocks access to the files instead for:
ID_DOWNLOAD/2.0 libcurl/7.12.2
and the server referrer?

greetz mike
booger
Posts: 119
Joined: Wed Mar 24, 2004 12:05 am

Post by booger »

a bit late but here----works
This is not an htaccess file but directly in the .conf

<Directory "/xxxxxxxxxxx">
SetEnvIf User-Agent ID_DOWNLOAD/2.0 libcurl/7.12.2
IndexOptions FancyIndexing IconHeight=22 IconWidth=22 IconsAreLinks HTMLTable
AddDescription "ET maps" pk3
AddDescription "Zip File" zip
DefaultType application/zip
AddIconByEncoding (pk3,/icons/pk3a.gif) x-pk3
order Deny,Allow
Deny from all
AllowOverride None
Allow from env=libcurl/7.12.2
</Directory>
Image
mike
Posts: 27
Joined: Thu Mar 17, 2005 8:09 am
Location: Germany
Contact:

Post by mike »

thanks
i will check this later.
currently iam very busy.

greetz mike
booger
Posts: 119
Joined: Wed Mar 24, 2004 12:05 am

Post by booger »

Code: Select all

SetEnvIf User-Agent ID_DOWNLOAD/2.0 libcurl/7.12.2
order Deny,Allow
Deny from all
Allow from env=libcurl/7.12.2
will work as .htaccess w/out needing the httpd.conf file edited

This by itself wouldnt prevent leaching of bandwidth from other servers,only direct browser access.
Image
User avatar
ReyalP
Posts: 1663
Joined: Fri Jul 25, 2003 11:44 am

Post by ReyalP »

Really, it is more likely you want to check the referer

People aiming their servers wwwbasurl at your server is far more likely to take up your bandwidth than random people pointing their browser at it.
send lawyers, guns and money
mike
Posts: 27
Joined: Thu Mar 17, 2005 8:09 am
Location: Germany
Contact:

Post by mike »

is it possible to check for my server referer only too?
User avatar
Deus
Posts: 1053
Joined: Fri Mar 12, 2004 2:24 am
Location: Germany
Contact:

Post by Deus »

maybe allow just this specific IP, but i have no idea if its possible and if yes how to do it
User avatar
gotenks
Posts: 3465
Joined: Fri Nov 15, 2002 4:12 pm
Location: out of my mind
Contact:

Post by gotenks »

yes it is possible, ever notice (for example) if you try using tripod.com as an image host it pops an anti leach image up?

unfortunately i don't know how
My Website
Image
After a night of binge drinking:
=FF=im2good4u wrote:WTF wanst i on top ?
mike
Posts: 27
Joined: Thu Mar 17, 2005 8:09 am
Location: Germany
Contact:

Post by mike »

but this only works if et sends the right information about the request.
referrer...

dont know if and what kind of et sends.
User avatar
gotenks
Posts: 3465
Joined: Fri Nov 15, 2002 4:12 pm
Location: out of my mind
Contact:

Post by gotenks »

it does in 2.60 not in 2.56
My Website
Image
After a night of binge drinking:
=FF=im2good4u wrote:WTF wanst i on top ?
mike
Posts: 27
Joined: Thu Mar 17, 2005 8:09 am
Location: Germany
Contact:

Post by mike »

good then i think i should add both.
User avatar
ReyalP
Posts: 1663
Joined: Fri Jul 25, 2003 11:44 am

Post by ReyalP »

The ET 2.60 referer looks like this:

Code: Select all

et&#58;//207.111.203.70&#58;27960/
Only with your ET server IP and port, of course :P
send lawyers, guns and money
booger
Posts: 119
Joined: Wed Mar 24, 2004 12:05 am

Post by booger »

Code: Select all

SetEnvIf Referer "ET&#58;//x.x.x.x&#58;27960" local_referal
order Deny,Allow
Deny from all
Allow from env=local_referal
in .htaccess /etmain or surround with <Directory> for httpd.conf

i 'think' you can call local_referal whatever you want. Really isn't any need to do both referer and libcurl.
Image
mike
Posts: 27
Joined: Thu Mar 17, 2005 8:09 am
Location: Germany
Contact:

Post by mike »

hm both works but not if i want to check both at same time in one config.
referer is enough.. normally..
but how to check both??

greetz mike
booger
Posts: 119
Joined: Wed Mar 24, 2004 12:05 am

Post by booger »

I think if you use both,the libcurl will override the referer,but Im not really sure.Or maybe you can tell to satisfy all variables.

Code: Select all

SetEnvIf User-Agent ID_DOWNLOAD/2.0 libcurl/7.12.2
SetEnvIf Referer "ET&#58;//x.x.x.x&#58;27960" local_referal
order Deny,Allow
Deny from all
Allow from env=libcurl/7.12.2
Allow from env=local_referal
Satisfy all


Image
Post Reply