|
Posted by Dave on 11/16/05 06:41
Philip Ronan wrote:
> "Dave" wrote:
>
>
>>I have set up a forum run by phpBB
>>
>>http://www.southminster-branch-line.org.uk/phpBB2/index.php
>>
>>but I'd like to prevent people posting from outside the UK. Is there an
>>easy way to do this? I can easily use Apache and GeoIP to do this by
>>denying access to a directory based on country, but that stops people
>>reading the messages too, which I do not want to do.
>
>
> Use Apache and GeoIP to filter out POST requests from non-UK IP addresses
>
> I'm not sure how things work with GeoIP, but with an htaccess file you could
> do someting like this, for example:
>
> <Limit POST>
> Order deny, allow
> Deny from all
> Allow from xx.xx.xx.xx
> Allow from yy.yy.yy.yy
> ...etc...
> </Limit>
>
> Don't expect this system to be foolproof; there are open proxies in the UK
> too.
>
Thank you. I was aware of that method, but it restricts them being read
as well, but I can't find a solution to that. I was happy for anyone to
read them, but not write.
As a matter of interest, GeoIP works like this below. It should be
fairly obvious. Note I first block Japan, then allow a specific IP in
Japan. I don't know if this works in a .htaccess file though - I've only
done it in httpd.conf
<IfModule mod_geoip.c>
GeoIPEnable On
SetEnvIf GEOIP_COUNTRY_CODE AR BlockCountry # Argentina
SetEnvIf GEOIP_COUNTRY_CODE BD BlockCountry # Bangladesh
SetEnvIf GEOIP_COUNTRY_CODE JP BlockCountry # Japan
Deny from env=BlockCountry
Deny from 80.77.86.240
Allow from 133.27.228.132 # W3C validator, in Japan
</IfModule>
--
Dave K
http://www.southminster-branch-line.org.uk/
Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Change the address if
needed before replying. The month is always written in full
(e.g. January, not Jan)
[Back to original message]
|