![]() |
help with htaccess
i tried this htaccess and it send all my traffic to my sponsor, can someone tell me whats wrong?
AuthUserFile /dev/null AuthGroupFile /dev/null AddType text/html .html .htm <Limit GET> order allow,deny allow from all deny from 212.138.47.* deny from 194.84.65.* deny from 212.113.37.194 deny from 217.80.182.65 deny from 213.76.163.16 allow from all </Limit> RewriteEngine On RewriteCond %{HTTP_REFERER} www.quality-thumbs.com [OR] RewriteCond %{HTTP_REFERER} quality-thumbs.com [or] RewriteRule /* http://www.lightspeedcash.com/link.php?s=LSU&r=245496 [L] RewriteOptions inherit RewriteCond %{HTTP_USER_AGENT} ^DISCo\Pump.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Drip.* [OR] RewriteCond %{HTTP_USER_AGENT} ^EirGrabber.* [OR] RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro.* [OR] RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE.* [OR] RewriteCond %{HTTP_USER_AGENT} ^FlashGet.* [OR] RewriteCond %{HTTP_USER_AGENT} ^GetRight.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Gets.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Grafula.* [OR] RewriteCond %{HTTP_USER_AGENT} ^IBrowse.* [OR] RewriteCond %{HTTP_USER_AGENT} ^InterGET.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Internet\Ninja.* [OR] RewriteCond %{HTTP_USER_AGENT} ^JetCar.* [OR] RewriteCond %{HTTP_USER_AGENT} ^JustView.* [OR] RewriteCond %{HTTP_USER_AGENT} ^MIDown\tool.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Mister\PiX.* [OR] RewriteCond %{HTTP_USER_AGENT} ^NearSite.* [OR] RewriteCond %{HTTP_USER_AGENT} ^NetSpider.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Offline\Explorer.* [OR] RewriteCond %{HTTP_USER_AGENT} ^PageGrabber.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Papa\Foto.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Pockey.* [OR] RewriteCond %{HTTP_USER_AGENT} ^ReGet.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Slurp.* [OR] RewriteCond %{HTTP_USER_AGENT} ^SpaceBison.* [OR] RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Teleport.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Teleport\Pro.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebAuto.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebCopier.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebFetch.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebReaper.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebSauger.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebStripper.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebWhacker.* [OR] RewriteCond %{HTTP_USER_AGENT} ^WebZIP.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Web\Image\Collector.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Web\Sucker.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Webster.* [OR] RewriteCond %{HTTP_USER_AGENT} ^Wget.* [OR] RewriteCond %{HTTP_USER_AGENT} ^eCatch.* [OR] RewriteCond %{HTTP_USER_AGENT} ^ia_archiver.* [OR] RewriteCond %{HTTP_USER_AGENT} ^lftp.* [OR] RewriteCond %{HTTP_USER_AGENT} ^tAkeOut.* RewriteCond %{HTTP_REFERER} ^http://.*trianca.com/*$ [NC] RewriteCond %{HTTP_REFERER} ^http://.*66.40.119.4:8084/*$ [NC] RewriteCond %{HTTP_REFERER} ^http://.*chatropolis.com/*$ [NC] RewriteRule /* http://www.lightspeedcash.com/link.php?s=LSU&r=245496 [R,L] #RewriteCond %{HTTP_REFERER} !^http://130.94.142.130/.*$ [NC] #RewriteCond %{HTTP_REFERER} !^http://.*idthumbs.com/.*$ [NC] RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://www.idthumbs.com/ ErrorDocument 403 /index.shtml ErrorDocument 404 /index.shtml |
Quote:
I see a number of errors and problems within the code, which apparently was pasted together from different examples that were found to address different issues. Nothing really wrong with that, except you inherent the typos and possible ignorance of the original author of each snippet. That, and modifying the code to suit your specifics without a grasp of the underlying concepts and rules of the grammar almost assures failure. Anyway: Code:
AuthUserFile /dev/null Code:
<Limit GET> Code:
RewriteEngine On Code:
RewriteEngine On Code:
RewriteCond %{HTTP_USER_AGENT} ^DISCo\Pump.* [OR] Keep in mind that Conditions are ANDed together by default. So, this section is saying- if any of the User_Agents are robots PLUS they are referred from trianca.com TOGETHER WITH trianca.com AND 66.40.119.4:8084 AS WELL AS chatropolis.com. Well, since there can be only one referrer for each request, as soon as you require two different ones in the Conditions, nothing will match. Now, you already have a section for quality-thumbs.com referrals to go to LightSpeed, so let's re-do that to include the others as well: Code:
RewriteEngine On Code:
RewriteCond %{HTTP_USER_AGENT} ^DISCo\Pump.* [OR] Now, the point is, ".*" is a wildcard match, it's going to match any and all requests. So, the rewrite engine is going to go through that list above it for every single hit. That is, unless a RewriteRule before it has an "L" flag, where the rule is never encountered. So, this code bit should go at the very last. No sense in making your server process all of this if the next rule sends the visitor off to your sponsor... Code:
#RewriteCond %{HTTP_REFERER} !^http://130.94.142.130/.*$ [NC] Code:
RewriteCond %{HTTP_REFERER} !^$ Code:
ErrorDocument 403 /index.shtml So, the final result (which should give you the desired behavior) would look like this: Code:
AuthUserFile /dev/null |
i'm not a fan of long .htaccess files personally (i've seen them drive up the server CPU to 0% idle in nothing flat), nor am i a big fan of blocking based on agent (how long til all websuckers default to IE's agent header)*, but i wonder if it'd just be better to run a whitelist of agents. i'd bet it'd be a lot smaller, especially since you can include 'Mozilla' to cover 95% of all browsers.
|
Good point, salsbury! I'd overlooked that while wading through everthing else. Plus, the User Agent can be faked as well. :mad:
Perhaps the best way to deal with this issue would be along the lines of a hitbot detector. Anyone know if there's such a program around that nails these web vacuums? |
i've set up scripts (real basic) that check for patterns (regular expressions) in the last say 5000 lines of a log file. if they reach a certain threshold it blocks them for a period, say an hour. harsh, but it catches 'em. the thing about it though, it's requires a lot of planning to set it up right - you want to be sure not to block someone for loading your page if it has 50 images. for example on one server i have it set to block if you've hit 25 different CGIs (other than a traffic counting one and admin ones, gotta exclude some too) in 5 minutes or so. this was necessary because the suckers were coming in and killing a server with their simultaneous connections - denial of service attack, basically. but this might not be appropriate for some sites, in fact probably not for most sites.
i think the only way to do it really well is to have something sitting in front of apache proxying traffic that handles the throttling based on whatever it determines is a "session" ip address, cookie, URL prepend, whatever. doing it in apache is just doomed of course - you have a limited number of httpd children ('cause of memory) and if some spider comes along and eats up 100 connections (it has happened), and they're all "sleeping" for a period while it throttles them, that's 100 connections that can't be used for anyone else. lame. :) |
thanks a ton for taking the time to reply, i really appreciate it.
|
i just tested it and it worked except the error 404. i tried this the other day with just the error404 line and it still didnt work. any ideas?
|
Quote:
Hope that helps!:thumbsup |
thanks once again 5eyes
|
fiveyes, you seem to be the authority on htaccess. Why don't you charge like 25$ each to make htaccess files for guys. This is a much needed market. I get people asking me all the time, and I have NO FUCKING clue. I just get friends to help me, and I hate asking anyone for something without paying them for it. If interested, let me know as I sell a lot of traffic to newbies, and they ask me all the time about this. Lots of business for this. Htaccess is a pain in the ass for oldtimers as well as newbies. Someone just needs to do it smart.
|
All times are GMT -7. The time now is 05:14 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123