Don't like ads? PRO users don't see any ads ;-)
Guest

htaccess code file

By: a guest on Sep 24th, 2012  |  syntax: None  |  size: 13.15 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ##
  2. # @version $Id: htaccess.txt 10492 2008-07-02 06:38:28Z ircmaxell $
  3. # @package Joomla
  4. # @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
  5. # @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  6. # Joomla! is Free Software
  7. ##
  8.  
  9.  
  10. #####################################################
  11. #  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
  12. #
  13. # The line just below this section: 'Options +FollowSymLinks' may cause problems
  14. # with some server configurations.  It is required for use of mod_rewrite, but may already
  15. # be set by your server administrator in a way that dissallows changing it in
  16. # your .htaccess file.  If using it causes your server to error out, comment it out (add # to
  17. # beginning of line), reload your site in your browser and test your sef url's.  If they work,
  18. # it has been set by your server administrator and you do not need it set here.
  19. #
  20. #####################################################
  21.  
  22. ##  Can be commented out if causes errors, see notes above.
  23. Options +FollowSymLinks
  24.  
  25. #
  26. #  mod_rewrite in use
  27.  
  28. RewriteEngine On
  29.  
  30. ########## Begin - Rewrite rules to block out some common exploits
  31. ## If you experience problems on your site block out the operations listed below
  32. ## This attempts to block the most common type of exploit `attempts` to Joomla!
  33. #
  34. # Block out any script trying to set a mosConfig value through the URL
  35. RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
  36. # Block out any script trying to base64_encode crap to send via URL
  37. RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
  38. # Block out any script that includes a <script> tag in URL
  39. RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
  40. # Block out any script trying to set a PHP GLOBALS variable via URL
  41. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  42. # Block out any script trying to modify a _REQUEST variable via URL
  43. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
  44. # Send all blocked request to homepage with 403 Forbidden error!
  45. RewriteRule ^(.*)$ index.php [F,L]
  46. #
  47. ########## End - Rewrite rules to block out some common exploits
  48.  
  49. #  Uncomment following line if your webserver's URL
  50. #  is not directly related to physical file paths.
  51. #  Update Your Joomla! Directory (just / for root)
  52.  
  53. # RewriteBase /
  54.  
  55.  
  56. ########## Begin - Joomla! core SEF Section
  57. #
  58. RewriteCond %{REQUEST_FILENAME} !-f
  59. RewriteCond %{REQUEST_FILENAME} !-d
  60. RewriteCond %{REQUEST_URI} !^/index.php
  61. RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
  62. RewriteRule (.*) index.php
  63. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
  64. #
  65. ########## End - Joomla! core SEF Section
  66.  
  67. ########## Begin - Netfirms customizations
  68. #--------------------------------
  69. #  Force php into version 5
  70. #--------------------------------
  71. #
  72. setenv PHPVERSION 5
  73. #
  74. #
  75. #--------------------------------
  76. #Deny access to all CGI, Perl, Python and text files
  77. #--------------------------------
  78. #
  79. <FilesMatch "\.(cgi|pl|py|txt)">
  80. Deny from all
  81. </FilesMatch>
  82. #
  83. #  Allow only robots.txt file, if not allowed add sign # at the start of following 3 lines
  84. #
  85. <FilesMatch robots.txt>
  86. Allow from all
  87. </FilesMatch>
  88. #
  89. #--------------------------------
  90. #Deny perl and other bots from accessing your site
  91. #--------------------------------
  92. #
  93. ########## start block bad bots
  94. SetEnvIfNoCase User-Agent "^EmailSiphon" bad_bot
  95. SetEnvIfNoCase User-Agent "^.*psycheclone" bad_bot
  96. SetEnvIfNoCase User-Agent "^EmailWolf" bad_bot
  97. SetEnvIfNoCase User-Agent "^ExtractorPro" bad_bot
  98. SetEnvIfNoCase User-Agent "^CherryPicker" bad_bot
  99. SetEnvIfNoCase User-Agent "^NICErsPRO" bad_bot
  100. SetEnvIfNoCase User-Agent "^Teleport" bad_bot
  101. SetEnvIfNoCase User-Agent "^EmailCollector" bad_bot
  102. SetEnvIfNoCase User-Agent "^LinkWalker" bad_bot
  103. SetEnvIfNoCase User-Agent "^Zeus" bad_bot
  104. SetEnvIfNoCase User-Agent "^Mozilla.*NEWT" bad_bot
  105. SetEnvIfNoCase User-Agent "^Crescent" bad_bot
  106. SetEnvIfNoCase User-Agent "^[Ww]eb[Bb]andit" bad_bot
  107. SetEnvIfNoCase User-Agent "^NICErsPRO" bad_bot
  108. SetEnvIfNoCase User-Agent "^WebEMailExtrac.*" bad_bot
  109. SetEnvIfNoCase User-Agent "^Microsoft.URL" bad_bot
  110. SetEnvIfNoCase User-Agent "^Wget" bad_bot
  111. SetEnvIfNoCase User-Agent "^DIIbot" bad_bot
  112. SetEnvIfNoCase User-Agent "^sitecheck.internetseer.com" bad_bot
  113. SetEnvIfNoCase User-Agent "^psbot" bad_bot
  114. SetEnvIfNoCase User-Agent "^libwww-perl" bad_bot
  115. #
  116. <Limit GET POST>
  117. Order Allow,Deny
  118. Allow from all
  119. Deny from env=bad_bot
  120. </Limit>
  121. ########## end block bad bots
  122. #
  123. ########## Start Spam protection
  124. #
  125. <IfModule mod_rewrite.c>
  126. RewriteEngine on
  127. # RewriteBase /
  128. RewriteCond %{HTTP_USER_AGENT} almaden [OR]
  129. RewriteCond %{HTTP_USER_AGENT} ^Anarchie [OR]
  130. RewriteCond %{HTTP_USER_AGENT} ^ASPSeek [OR]
  131. RewriteCond %{HTTP_USER_AGENT} ^attach [OR]
  132. RewriteCond %{HTTP_USER_AGENT} ^autoemailspider [OR]
  133. RewriteCond %{HTTP_USER_AGENT} ^BackWeb [OR]
  134. RewriteCond %{HTTP_USER_AGENT} ^Bandit [OR]
  135. RewriteCond %{HTTP_USER_AGENT} ^BatchFTP [OR]
  136. RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
  137. RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [OR]
  138. RewriteCond %{HTTP_USER_AGENT} ^Buddy [OR]
  139. RewriteCond %{HTTP_USER_AGENT} ^bumblebee [OR]
  140. RewriteCond %{HTTP_USER_AGENT} ^CherryPicker [OR]
  141. RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
  142. RewriteCond %{HTTP_USER_AGENT} ^CICC [OR]
  143. RewriteCond %{HTTP_USER_AGENT} ^Collector [OR]
  144. RewriteCond %{HTTP_USER_AGENT} ^Copier [OR]
  145. RewriteCond %{HTTP_USER_AGENT} ^Crescent [OR]
  146. RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
  147. RewriteCond %{HTTP_USER_AGENT} ^DA [OR]
  148. RewriteCond %{HTTP_USER_AGENT} ^DIIbot [OR]
  149. RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR]
  150. RewriteCond %{HTTP_USER_AGENT} ^DISCo\ Pump [OR]
  151. RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR]
  152. RewriteCond %{HTTP_USER_AGENT} ^Download\ Wonder [OR]
  153. RewriteCond %{HTTP_USER_AGENT} ^Downloader [OR]
  154. RewriteCond %{HTTP_USER_AGENT} ^Drip [OR]
  155. RewriteCond %{HTTP_USER_AGENT} ^DSurf15a [OR]
  156. RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
  157. RewriteCond %{HTTP_USER_AGENT} ^EasyDL/2.99 [OR]
  158. RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR]
  159. RewriteCond %{HTTP_USER_AGENT} email [NC,OR]
  160. RewriteCond %{HTTP_USER_AGENT} ^EmailCollector [OR]
  161. RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
  162. RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
  163. RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR]
  164. RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
  165. RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR]
  166. RewriteCond %{HTTP_USER_AGENT} ^FileHound [OR]
  167. RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]
  168. RewriteCond %{HTTP_USER_AGENT} FrontPage [NC,OR]
  169. RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]
  170. RewriteCond %{HTTP_USER_AGENT} ^GetSmart [OR]
  171. RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR]
  172. RewriteCond %{HTTP_USER_AGENT} ^gigabaz [OR]
  173. RewriteCond %{HTTP_USER_AGENT} ^Go\!Zilla [OR]
  174. RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR]
  175. RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR]
  176. RewriteCond %{HTTP_USER_AGENT} ^gotit [OR]
  177. RewriteCond %{HTTP_USER_AGENT} ^Grabber [OR]
  178. RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR]
  179. RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR]
  180. RewriteCond %{HTTP_USER_AGENT} ^grub-client [OR]
  181. RewriteCond %{HTTP_USER_AGENT} ^HMView [OR]
  182. RewriteCond %{HTTP_USER_AGENT} ^HTTrack [OR]
  183. RewriteCond %{HTTP_USER_AGENT} ^httpdown [OR]
  184. RewriteCond %{HTTP_USER_AGENT} .*httrack.* [NC,OR]
  185. RewriteCond %{HTTP_USER_AGENT} ^ia_archiver [OR]
  186. RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR]
  187. RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR]
  188. RewriteCond %{HTTP_USER_AGENT} ^Indy*Library [OR]
  189. RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR]
  190. RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR]
  191. RewriteCond %{HTTP_USER_AGENT} ^InternetLinkagent [OR]
  192. RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR]
  193. RewriteCond %{HTTP_USER_AGENT} ^InternetSeer.com [OR]
  194. RewriteCond %{HTTP_USER_AGENT} ^Iria [OR]
  195. RewriteCond %{HTTP_USER_AGENT} ^JBH*agent [OR]
  196. RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR]
  197. RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR]
  198. RewriteCond %{HTTP_USER_AGENT} ^JustView [OR]
  199. RewriteCond %{HTTP_USER_AGENT} ^larbin [OR]
  200. RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR]
  201. RewriteCond %{HTTP_USER_AGENT} ^LexiBot [OR]
  202. RewriteCond %{HTTP_USER_AGENT} ^lftp [OR]
  203. RewriteCond %{HTTP_USER_AGENT} ^Link*Sleuth [OR]
  204. RewriteCond %{HTTP_USER_AGENT} ^likse [OR]
  205. RewriteCond %{HTTP_USER_AGENT} ^Link [OR]
  206. RewriteCond %{HTTP_USER_AGENT} ^LinkWalker [OR]
  207. RewriteCond %{HTTP_USER_AGENT} ^Mag-Net [OR]
  208. RewriteCond %{HTTP_USER_AGENT} ^Magnet [OR]
  209. RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR]
  210. RewriteCond %{HTTP_USER_AGENT} ^Memo [OR]
  211. RewriteCond %{HTTP_USER_AGENT} ^Microsoft.URL [OR]
  212. RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR]
  213. RewriteCond %{HTTP_USER_AGENT} ^Mirror [OR]
  214. RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR]
  215. RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*Indy [OR]
  216. RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*NEWT [OR]
  217. RewriteCond %{HTTP_USER_AGENT} ^Mozilla*MSIECrawler [OR]
  218. RewriteCond %{HTTP_USER_AGENT} ^MS\ FrontPage* [OR]
  219. RewriteCond %{HTTP_USER_AGENT} ^MSFrontPage [OR]
  220. RewriteCond %{HTTP_USER_AGENT} ^MSIECrawler [OR]
  221. RewriteCond %{HTTP_USER_AGENT} ^MSProxy [OR]
  222. RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR]
  223. RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR]
  224. RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR]
  225. RewriteCond %{HTTP_USER_AGENT} ^NetMechanic [OR]
  226. RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR]
  227. RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR]
  228. RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR]
  229. RewriteCond %{HTTP_USER_AGENT} ^NICErsPRO [OR]
  230. RewriteCond %{HTTP_USER_AGENT} ^Ninja [OR]
  231. RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR]
  232. RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR]
  233. RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR]
  234. RewriteCond %{HTTP_USER_AGENT} ^Openfind [OR]
  235. RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR]
  236. RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR]
  237. RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR]
  238. RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR]
  239. RewriteCond %{HTTP_USER_AGENT} ^Ping [OR]
  240. RewriteCond %{HTTP_USER_AGENT} ^PingALink [OR]
  241. RewriteCond %{HTTP_USER_AGENT} ^Pockey [OR]
  242. RewriteCond %{HTTP_USER_AGENT} ^psbot [OR]
  243. RewriteCond %{HTTP_USER_AGENT} ^Pump [OR]
  244. RewriteCond %{HTTP_USER_AGENT} ^QRVA [OR]
  245. RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR]
  246. RewriteCond %{HTTP_USER_AGENT} ^Reaper [OR]
  247. RewriteCond %{HTTP_USER_AGENT} ^Recorder [OR]
  248. RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR]
  249. RewriteCond %{HTTP_USER_AGENT} ^Scooter [OR]
  250. RewriteCond %{HTTP_USER_AGENT} ^Seeker [OR]
  251. RewriteCond %{HTTP_USER_AGENT} ^Siphon [OR]
  252. RewriteCond %{HTTP_USER_AGENT} ^sitecheck.internetseer.com [OR]
  253. RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR]
  254. RewriteCond %{HTTP_USER_AGENT} ^SlySearch [OR]
  255. RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR]
  256. RewriteCond %{HTTP_USER_AGENT} ^Snake [OR]
  257. RewriteCond %{HTTP_USER_AGENT} ^SpaceBison [OR]
  258. RewriteCond %{HTTP_USER_AGENT} ^sproose [OR]
  259. RewriteCond %{HTTP_USER_AGENT} ^Stripper [OR]
  260. RewriteCond %{HTTP_USER_AGENT} ^Sucker [OR]
  261. RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR]
  262. RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR]
  263. RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR]
  264. RewriteCond %{HTTP_USER_AGENT} ^Szukacz [OR]
  265. RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR]
  266. RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR]
  267. RewriteCond %{HTTP_USER_AGENT} ^URLSpiderPro [OR]
  268. RewriteCond %{HTTP_USER_AGENT} ^Vacuum [OR]
  269. RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]
  270. RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR]
  271. RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR]
  272. RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR]
  273. RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit [OR]
  274. RewriteCond %{HTTP_USER_AGENT} ^webcollage [OR]
  275. RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
  276. RewriteCond %{HTTP_USER_AGENT} ^Web\ Downloader [OR]
  277. RewriteCond %{HTTP_USER_AGENT} ^WebEMailExtrac.* [OR]
  278. RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR]
  279. RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR]
  280. RewriteCond %{HTTP_USER_AGENT} ^WebHook [OR]
  281. RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR]
  282. RewriteCond %{HTTP_USER_AGENT} ^WebMiner [OR]
  283. RewriteCond %{HTTP_USER_AGENT} ^WebMirror [OR]
  284. RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR]
  285. RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR]
  286. RewriteCond %{HTTP_USER_AGENT} ^Website [OR]
  287. RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR]
  288. RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR]
  289. RewriteCond %{HTTP_USER_AGENT} ^Webster [OR]
  290. RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
  291. RewriteCond %{HTTP_USER_AGENT} WebWhacker [OR]
  292. RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
  293. RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
  294. RewriteCond %{HTTP_USER_AGENT} ^Whacker [OR]
  295. RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
  296. RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]
  297. RewriteCond %{HTTP_USER_AGENT} ^x-Tractor [OR]
  298. RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
  299. RewriteCond %{HTTP_USER_AGENT} ^Xenu [OR]
  300. RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster [OR]
  301. RewriteCond %{HTTP_USER_AGENT} ^Zeus
  302. RewriteRule ^.* - [F,L]
  303. </IfModule>
  304. #
  305. # End Spam Protection
  306. #
  307. #--------------------------------
  308. # Block direct access to critical files
  309. #--------------------------------
  310. #
  311. <Files .htaccess>
  312. order allow,deny
  313. deny from all
  314. </Files>
  315. #
  316. <FilesMatch "configuration.php">
  317. Order allow,deny
  318. Deny from all
  319. </FilesMatch>
  320. #
  321. #
  322. ########## End - Netfirms customizations