Tuesday, March 24, 2009

Block all the vistors from one country

I am using PHP, so I just talk someting about Apache. Hope it is something you are searching for.

Due to some reasons, some webmasters may want to block the traffic from one country. It's very easy to do it with the .htaccess file of the Apache. The following is the basic grammar.
order allow,deny
allow from all

# specific IP address
deny from 123.123.123.123
# deny a range: 123.123.0.0 - 123.123.255.255
deny from 123.123.0.0/16
# the whole class: 123.0.0.0 - 123.255.255.255
deny from 123.0.0.0/8
# shorthand for previous
deny from 123

Like the above, just change the IP range to the speific range and add to your .htaccess file. Then you can block a country. The most complex thing is to get the up-to-date IP range of the specific country. I just got a result from Google that who provides the IP range of all countries for free. Please check the following link.

http://www.blockacountry.com/

So, now everything is solved.

If you want to know more about the .htaccess file. Please check .htaccess tips and tricks.

Monday, March 23, 2009

IE 8 vs Google?

An interesting title?

Microsoft lauched IE 8.0 on 20th Mar. 2009. I updated my IE at the earliest time. Have you got yours? If not, check here to download.

I found a very intersting thing. I don't know whether it is the problem of my computer. But I just want to share with you here. When I first open google.com by IE 8.0, the buttons on the google homepage becomes very small. Take a look at the following screen shot.
I tested the new IE in the following days. First I thought it's just the problem of my cache files. But I cleared all the cache files, the problem still occured. Everything is OK with IE 7.0 and Firefox 3.0.7(OS XP SP2). Is it done by MS on purpose or a bug of the new version? I don't know. May be you meet the same problem?