Facebook
From Sloppy Macaw, 7 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 268
  1. <IfModule mod_rewrite.c>
  2.     RewriteEngine On
  3.     RewriteBase /
  4.     RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
  5.     RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
  6.     RewriteRule .* – [F,L]
  7.     RewriteCond %{QUERY_STRING} (\"|%22).*(<|>|%3) [NC,OR]
  8.     RewriteCond %{QUERY_STRING} (javascript:).*(\;) [NC,OR]
  9.     RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3) [NC,OR]
  10.     RewriteCond %{QUERY_STRING} (\;|\'|\"|%22).*(union|select|insert|drop|update|md5|benchmark|or|and|if) [NC,OR]
  11.     RewriteCond %{QUERY_STRING} (base64_encode|localhost|mosconfig) [NC,OR]
  12.     RewriteCond %{QUERY_STRING} (boot\.ini|echo.*kae|etc/passwd) [NC,OR]
  13.     RewriteCond %{QUERY_STRING} (GLOBALS|REQUEST)(=|\[|%) [NC]
  14.     RewriteRule .* - [E=BadQueryString,F]
  15.  
  16.     RewriteRule ^ - [E=BASE:/] [L]
  17.        
  18.     RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
  19.     RewriteCond %{HTTPS} off [OR]
  20.     RewriteCond %{HTTPS}:s on:(s)
  21.     RewriteRule ^(.*)$ http%1://www.%{HTTP_HOST}/$1 [R=301,L]
  22.  
  23.     RewriteCond %{REQUEST_URI} /admin/
  24.     RewriteRule .* - [S=2]
  25.  
  26.     RewriteRule ^(.*)index\.php$ %{ENV:BASE}$1 [R=301,L]
  27.  
  28.     RewriteCond %{REQUEST_FILENAME} !-f
  29.     RewriteCond %{REQUEST_FILENAME} !-d
  30.     RewriteRule ^([a-zA-Z0-9!-/]*)$ %{ENV:BASE} [L]
  31. </IfModule>