All pastes #928339 Raw Edit

tomfmason

public text v1 · immutable
·published 2008-03-04 23:31 UTC
rendered paste body
<IfModule mod_rewrite.c>
   RewriteEngine on
   # Block out any script trying to base64_encode crap to send via URL
   RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
   # Block out any script that includes a <script> tag in URL
   RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
   # Block out any script trying to set a PHP GLOBALS variable via URL
   RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
   # Block out any script trying to modify a _REQUEST variable via URL
   RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
   # Send all blocked request to homepage with 403 Forbidden error!
   RewriteRule ^(.*)$ /forums/index.php [F,L]
   # Send anything else that we don't want to a 403
   RewriteCond %{REQUEST_URI} !^/(index\.php|forums/index\.php|forums/Themes/(.*)/(.*)\.(css|js)|forums/Themes/(.*)/images/(.*)\.(jpg|png|gif))
   RewriteRule ^(.*)$ /forums/index.php [F,L]
</IfModule>