AddDefaultCharset windows-1251
php_value default_charset windows-1251


php_flag display_errors off


# php_value session.cookie_domain .site.com


#    ,     


php_flag register_globals off
php_flag allow_url_include off
php_flag allow_url_fopen off


DirectoryIndex index.php


#    


Options -Indexes


#  .htaccess 


<files .htaccess>
order allow,deny
deny from all
</files>


php_value upload_max_filesize 5M
php_value post_max_size 5M


RewriteEngine on
RewriteBase /


RewriteRule ^exit/? index.php?exit=1
RewriteRule ^login/? index.php?page=login
RewriteRule ^bonus_gift/$ index.php?page=bonus_gift
RewriteRule ^contest_ref/? index.php?page=contest_ref
RewriteRule ^contest_bet/? index.php?page=contest_bet
RewriteRule ^contest_up/? index.php?page=contest_up
RewriteRule ^faq/? index.php?page=faq
RewriteRule ^news/([0-9]*)$ index.php?page=news&str=$1
RewriteRule ^news/r([0-9]*)$ index.php?page=news&id=$1
RewriteRule ^refs/(.*)? index.php?page=refs&$1
RewriteRule ^contacts/? index.php?page=contacts
RewriteRule ^profile/([0-9]*)\_([0-9a-z]+)/?$ index.php?page=a_profile&p_id=$1_$2
RewriteRule ^cab/ index.php?page=cab
RewriteRule ^support/$ index.php?page=support_main
RewriteRule ^support/([0-9]+)$ index.php?page=support_main&str=$1
RewriteRule ^support_dialog/([0-9]*)$ index.php?page=support_dialog&to=$1
RewriteRule ^serf_main/? index.php?page=serf_main
RewriteRule ^serf_buy/? index.php?page=serf_buy
RewriteRule ^serf_edit_list/? index.php?page=serf_edit_list
RewriteRule ^serf_edit_form/([0-9]*)? index.php?page=serf_edit_form&id=$1
RewriteRule ^serf_edit_admin/([0-9]*)? index.php?page=serf_edit_admin&id=$1
RewriteRule ^serf_view/? ajax/serf_view.php
RewriteRule ^ms/? index.php?page=ms
RewriteRule ^gizmo/? index.php?page=gizmo
RewriteRule ^promocode/? index.php?page=promocode
RewriteRule ^chat/$ index.php?page=chat


RewriteRule ^branch/$ index.php?page=branch
RewriteRule ^bubbles/$ index.php?page=bubbles


RewriteRule ^w/?$ index.php?page=w
RewriteRule ^w/([0-9]*)$ index.php?page=w&str=$1
RewriteRule ^up/$ index.php?page=up
RewriteRule ^up/1/([0-9]*)$ index.php?page=up&str=$1
RewriteRule ^up/2/([0-9]*)$ index.php?page=up&str_2=$1
RewriteRule ^up/fail/?$ index.php?page=up&fail=1
RewriteRule ^up/success/?$ index.php?page=up&success=1


RewriteRule ^deps/$ index.php?page=deps
RewriteRule ^deps/([0-9]*)/([0-9]*)/$ index.php?page=deps&str=$1&sort=$2


# BLOCK MYSQL INJECTIONS, RFI, base64, etc.


RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC,OR]
RewriteCond %{QUERY_STRING} \=PHP[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} [NC,OR]
RewriteCond %{QUERY_STRING} (\.\./|\.\.) [OR]
RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
RewriteCond %{QUERY_STRING} http\: [NC,OR]
RewriteCond %{QUERY_STRING} https\: [NC,OR]
RewriteCond %{QUERY_STRING} \=\|w\| [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)/self/(.*)$ [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)cPath=http://(.*)$ [NC,OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^i]*i)+frame.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
RewriteCond %{QUERY_STRING} base64_(en|de)code[^(]*\([^)]*\) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>).* [NC,OR]
RewriteCond %{QUERY_STRING} (NULL|OUTFILE|LOAD_FILE) [OR]
RewriteCond %{QUERY_STRING} (\./|\../|\.../)+(motd|etc|bin) [NC,OR]
RewriteCond %{QUERY_STRING} (localhost|loopback|127\.0\.0\.1) [NC,OR]
RewriteCond %{QUERY_STRING} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
RewriteCond %{QUERY_STRING} concat[^\(]*\( [NC,OR]
RewriteCond %{QUERY_STRING} union([^s]*s)+elect [NC,OR]
RewriteCond %{QUERY_STRING} union([^a]*a)+ll([^s]*s)+elect [NC,OR]
RewriteCond %{QUERY_STRING} (;|<|>|'|"|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|drop|delete|update|cast|create|char|convert|alter|declare|order|script|set|md5|benchmark|encode) [NC,OR]
RewriteCond %{QUERY_STRING} (sp_executesql) [NC]
RewriteRule ^(.*)$ index.php [F,L]


# REQUEST METHOD, REFERER, COOKIE


RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK)
RewriteCond %{HTTP_REFERER} ^(.*)(<|>||%0A|%0D|%27|%3C|%3E|%00).* [NC,OR]
RewriteCond %{HTTP_COOKIE} ^.*(<|>||%0A|%0D|%27|%3C|%3E|%00).* [NC,OR]
RewriteRule ^(.*)$ index.php [F,L]


# BROWSER AND REQUESTS


RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} (libwww-perl|python|nikto|curl|scan|java|winhttp|clshttp|loader) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (;|<|>|'|"|\)|\(|%0A|%0D|%22|%27|%28|%3C|%3E|%00).*(libwww-perl|python|nikto|curl|scan|java|winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR]
RewriteCond %{THE_REQUEST} \?\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} \/\*\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} etc/passwd [NC,OR]
RewriteCond %{THE_REQUEST} cgi-bin
RewriteRule ^(.*)$ index.php [F,L]


# BAD BOTS TRAFFIC


<IfModule mod_setenvif.c>
BrowserMatchNoCase "^(aesop_com_spiderman|alexibot|backweb|bandit|batchftp|bigfoot)" bad_bot
BrowserMatchNoCase "^(black.?hole|blackwidow|blowfish|botalot|buddy|builtbottough|bullseye)" bad_bot
BrowserMatchNoCase "^(cheesebot|cherrypicker|chinaclaw|collector|copier|copyrightcheck)" bad_bot
BrowserMatchNoCase "^(cosmos|crescent|curl|custo|da|diibot|disco|dittospyder|dragonfly)" bad_bot
BrowserMatchNoCase "^(drip|easydl|ebingbong|ecatch|eirgrabber|emailcollector|emailsiphon)" bad_bot
BrowserMatchNoCase "^(emailwolf|erocrawler|exabot|eyenetie|filehound|flashget|flunky)" bad_bot
BrowserMatchNoCase "^(frontpage|getright|getweb|go.?zilla|go-ahead-got-it|gotit|grabnet)" bad_bot
BrowserMatchNoCase "^(grafula|harvest|hloader|hmview|httplib|httrack|humanlinks|ilsebot)" bad_bot
BrowserMatchNoCase "^(infonavirobot|infotekies|intelliseek|interget|iria|jennybot|jetcar)" bad_bot
BrowserMatchNoCase "^(joc|justview|jyxobot|kenjin|keyword|larbin|leechftp|lexibot|lftp|libweb)" bad_bot
BrowserMatchNoCase "^(likse|linkscan|linkwalker|lnspiderguy|lwp|magnet|mag-net|markwatch)" bad_bot
BrowserMatchNoCase "^(mata.?hari|memo|microsoft.?url|midown.?tool|miixpc|mirror|missigua|missauga)" bad_bot
BrowserMatchNoCase "^(mister.?pix|moget|mozilla.?newt|nameprotect|navroad|backdoorbot|nearsite)" bad_bot
BrowserMatchNoCase "^(net.?vampire|netants|netcraft|netmechanic|netspider|nextgensearchbot)" bad_bot
BrowserMatchNoCase "^(attach|nicerspro|nimblecrawler|npbot|octopus|offline.?explorer)" bad_bot
BrowserMatchNoCase "^(offline.?navigator|openfind|outfoxbot|pagegrabber|papa|pavuk)" bad_bot
BrowserMatchNoCase "^(pcbrowser|php.?version.?tracker|pockey|propowerbot|prowebwalker)" bad_bot
BrowserMatchNoCase "^(psbot|pump|queryn|recorder|realdownload|reaper|reget|true_robot)" bad_bot
BrowserMatchNoCase "^(repomonkey|rma|internetseer|sitesnagger|siphon|slysearch|smartdownload)" bad_bot
BrowserMatchNoCase "^(snake|snapbot|snoopy|sogou|spacebison|spankbot|spanner|sqworm|superbot)" bad_bot
BrowserMatchNoCase "^(superhttp|surfbot|asterias|suzuran|szukacz|takeout|teleport)" bad_bot
BrowserMatchNoCase "^(telesoft|the.?intraformant|thenomad|tighttwatbot|titan|urldispatcher)" bad_bot
BrowserMatchNoCase "^(turingos|turnitinbot|urly.?warning|vacuum|vci|voideye|whacker)" bad_bot
BrowserMatchNoCase "^(libwww-perl|widow|wisenutbot|wwwoffle|xaldon|xenu|zeus|zyborg|anonymouse)" bad_bot
BrowserMatchNoCase "^(abot|aipbot|EI|LWP|MSIECrawler|PlantyNet_WebRobot|UCmore)" bad_bot
BrowserMatchNoCase "^web(zip|emaile|enhancer|fetch|go.?is|auto|bandit|clip|copier|master|reaper|sauger|site.?quester|whack)" bad_bot
BrowserMatchNoCase "^.*(craftbot|download|extract|stripper|sucker|ninja|clshttp|webspider|leacher|collector|grabber|webpictures|jeteye).*$" bad_bot
BrowserMatchNoCase "(Alligator|AllSubmitter|Anonymous|autoemailspider|Badass|Baiduspider|BecomeBot)" bad_bot
BrowserMatchNoCase "(Bitacle|bladder\ fusion|Blogshares\ Spiders|Board\ Bot|Convera|ConveraMultiMediaCrawler|c-spider)" bad_bot
BrowserMatchNoCase "(DA|DnloadMage|Download\ Demon|Download\ Express|Download\ Wonder|dragonfly|DreamPassport)" bad_bot
BrowserMatchNoCase "(DSurf|DTS\ Agent|EBrowse|eCatch|edgeio|Email\ Extractor|EmeraldShield)" bad_bot
BrowserMatchNoCase "(ESurf|ExtractorPro|FileHeap\!\ file downloader|Forex|Franklin\ Locator|FreshDownload|FSurf)" bad_bot
BrowserMatchNoCase "(Gaisbot|Gamespy_Arcade|genieBot|GetBot|Gigabot|GOFORITBOT|heritrix)" bad_bot
BrowserMatchNoCase "(HooWWWer|iCCrawler|ichiro|iGetter|imds_monitor|Industry\ Program|Indy\ Library)" bad_bot
BrowserMatchNoCase "(InetURL|InstallShield\ DigitalWizard|IRLbot|IUPUI\ Research\ Bot|JoBo)" bad_bot
BrowserMatchNoCase "(Kapere|LeechGet|LightningDownload|Linkie|Mac\ Finder|Mail\ Sweeper|Mass\ Downloader)" bad_bot
BrowserMatchNoCase "(MetaProducts\ Download\ Express|Microsoft\ Data\ Access|Microsoft\ URL\ Control|Missouri\ College\ Browse|MovableType|Mozi\!|Mozilla/3\.0 (compatible))" bad_bot
BrowserMatchNoCase "(Mozilla/5\.0 (compatible\; MSIE 5\.0)|MSIE_6\.0|MVAClient|MyFamilyBot|MyGetRight|NASA\ Search|Naver)" bad_bot
BrowserMatchNoCase "(NaverBot|NetResearchServer|NEWT\ ActiveX|Nextopia|Nitro\ Downloader|Nutch|OmniExplorer)" bad_bot
BrowserMatchNoCase "(P3P|PagmIEDownload|playstarmusic|Program\ Shareware|Progressive\ Download|psycheclone|puf)" bad_bot
BrowserMatchNoCase "(PussyCat|PuxaRapido|Python-urllib|RedKernel|relevantnoise|RTG30|SBIder)" bad_bot
BrowserMatchNoCase "(script|Seekbot|sna-|Snap\ bot|SpeedDownload|Sphere|sproose)" bad_bot
BrowserMatchNoCase "(SQ\ Webscanner|Stamina|Star\ Downloader|UdmSearch|URLGetFile|User-Agent|UtilMind\ HTTPGet)" bad_bot
BrowserMatchNoCase "(WebAuto|WebCapture|webcollage|WebCopier|WebFilter|WebReaper|Website\ eXtractor)" bad_bot
BrowserMatchNoCase "(WebStripper|WebZIP|Wells\ Search|WEP\ Search\ 00|Wildsoft\ Surfer|WinHttpRequest)" bad_bot
BrowserMatchNoCase "(Y\!TunnelPro|YahooYSMcm|Zade|ZBot|zerxbot)" bad_bot

Deny from env=bad_bot
</ifModule>
