Skip to content

Instantly share code, notes, and snippets.

@jennimckinnon
Created May 18, 2016 23:31
Show Gist options
  • Select an option

  • Save jennimckinnon/24532cde82a6aa58a229268a623f8831 to your computer and use it in GitHub Desktop.

Select an option

Save jennimckinnon/24532cde82a6aa58a229268a623f8831 to your computer and use it in GitHub Desktop.
Prevent script injections using GLOBALS and _REQUEST variable in WordPress. Source: http://www.wprecipes.com/protect-your-wordpress-blog-using-htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment