Advertisement
Guest User

Spartabots htaccess

a guest
Dec 7th, 2011
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.39 KB | None | 0 0
  1. # This is a comment
  2. # spartabots.co.cc
  3.  
  4.  
  5. # Not sure what this does (but leave this alone)
  6. IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
  7.  
  8.  
  9. # Enable better indexing in folders
  10. IndexOptions FancyIndexing
  11. IndexOptions FoldersFirst
  12. IndexOptions NameWidth=*
  13.  
  14. # Remove www from urls
  15. RewriteEngine On
  16. RewriteBase /
  17. RewriteCond %{HTTP_HOST} ^www.spartabots.co.cc [NC]
  18. RewriteRule ^(.*)$ http://spartabots.co.cc/$1 [L,R=301]
  19.  
  20. # Compress files
  21. AddOutputFilterByType DEFLATE text/plain
  22. AddOutputFilterByType DEFLATE text/html
  23. AddOutputFilterByType DEFLATE text/xml
  24. AddOutputFilterByType DEFLATE text/css
  25. AddOutputFilterByType DEFLATE application/xml
  26. AddOutputFilterByType DEFLATE rss+xml
  27. AddOutputFilterByType DEFLATE application/javascript
  28. AddOutputFilterByType DEFLATE application/x-javascript
  29.  
  30.  
  31. # Cache-Control Headers
  32. # Ages in seconds.
  33. <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
  34. Header set Cache-Control max-age=2592000
  35. </filesMatch>
  36. <filesMatch "\.(js)$">
  37. Header set Cache-Control max-age=604800
  38. </filesMatch>
  39. <filesMatch "\.(css|html|php)$">
  40. Header set Cache-Control max-age=43200
  41. </filesMatch>
  42.  
  43.  
  44. # Error documents
  45. ErrorDocument 403 /errors/403.php
  46. ErrorDocument 404 /errors/404.php
  47. ErrorDocument 418 /errors/418.php
  48. ErrorDocument 500 /errors/500.php
  49.  
  50.  
  51. # Enable server side includes for html
  52. AddHandler server-parsed .html
  53. AddHandler server-parsed .shtml
  54. Options Indexes FollowSymLinks Includes
  55.  
  56.  
  57. # Force browser to download and not simply view these files
  58. AddType application/octet-stream .doc
  59. AddType application/octet-stream .docx
  60. AddType application/octet-stream .rtf
  61. AddType application/octet-stream .wpd
  62. AddType application/octet-stream .txt
  63. AddType application/octet-stream .pdf
  64. AddType application/octet-stream .midi
  65. AddType application/octet-stream .mp3
  66. AddType application/octet-stream .pps
  67. AddType application/octet-stream .ppt
  68. AddType application/octet-stream .pptx
  69. AddType application/octet-stream .xlr
  70. AddType application/octet-stream .xls
  71. AddType application/octet-stream .xlsx
  72. AddType application/octet-stream .exe
  73. AddType application/octet-stream .jar
  74.  
  75.  
  76. # Helps prevent hacks
  77. RewriteEngine On
  78.  
  79. # proc/self/environ is bad
  80. RewriteCond %{QUERY_STRING} proc/self/environ [OR]
  81.  
  82. # Block out any script trying to set a mosConfig value through the URL
  83. RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
  84.  
  85. # Block out any script trying to base64_encode crap to send via URL
  86. RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]
  87.  
  88. # Block out any script that includes a <script> tag in URL
  89. RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
  90.  
  91. # Block out any script trying to set a PHP GLOBALS variable via URL
  92. RewriteCond %{QUERY_STRING} GLOBALS(=|[|\%[0-9A-Z]{0,2}) [OR]
  93.  
  94. # Block out any script trying to modify a _REQUEST variable via URL
  95. RewriteCond %{QUERY_STRING} _REQUEST(=|[|\%[0-9A-Z]{0,2})
  96.  
  97. # Send all blocked request to homepage with 403 Forbidden error!
  98. RewriteRule ^(.*)$ index.php [F,L]
  99.  
  100.  
  101. # Enable a few older IE browsers to use a newer Chrome framework
  102. Header set X-UA-Compatible "IE-edge"
  103.  
  104. # Misc stuff
  105. AddType application/atom+xml .atom
  106. SetEnv SERVER_ADMIN admin@spartabots.co.cc
  107.  
  108.  
  109. # Not sure what these do (but leave these alone)
  110. <Limit GET POST>
  111. order deny,allow
  112. deny from all
  113. allow from all
  114. </Limit>
  115. <Limit PUT DELETE>
  116. order deny,allow
  117. deny from all
  118. </Limit>
  119. AuthName spartabots.co.cc
  120.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement