Configure htacess to block IPs entire country

​Blocking an entire country stops most traffic coming from their IP ranges.
This method isn’t 100% because some countries have slightly overlapping IP ranges.

Alternatively, you can select a single country and DENY access from all other
countries to completely block access from the rest of the world. Due to overlapping
border ranges, selecting some neighbors is recommended such as US and CA as a pair.

http://incredibill.me/htaccess-block-country-ips

More can follow:

configure non-www to www

## Redirect from non-www to www (remove the two lines below to enable)
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s