Subscribe to be notified for updates: RSS Feed

Blog
How to Protect WordPress blog using .htaccess

12 Jan
2011

How to Protect WordPress blog using .htaccess

Author:
Comments: 0
wp .htaccess

Image credit: ptz0n

The .htaccess file have a great deal of possibilities. Today, let’s observe how we could protect our WordPress blog from scripts injection, and unwanted modification of _REQUEST and/or GLOBALS.

1- Paste the next lines into your .htaccess file. This file is located at the root of your WordPress install.

2- Always create a backup of one’s .htaccess file before editing it so, you can restore it if something went wrong.

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]

NO comments yet