Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

BLOCK ACCESS IP FROM CHINA

BLOCK ACCESS IP FROM CHINA

Hi Stephen,

I'm creating a new topic because it concern another recipe. We are still working on the same website: http://www.new.saishopweb.com/

Our client is in the fashion industry and fears copy from China. So he would like to block access to his website (Virtuemart part)for this country.

What would be your advice?

Cheers,

Marc

Edited By: IMPACT360
25-Mar-10 11:54:26

IMPACT360
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Re: BLOCK ACCESS IP FROM CHINA

Hi,

We are trying to install GeoIP. We found on your website this instruction:

"...then place it at the location geoip/GeoIP.dat in the Joomla installation..."

Could you please be more specific. Do we have to drop the dat file in the Metamod installation file (for example in /modules/mod_metamod/mod_metamod/geoip-php4) or do we have to create a file at the root of Joomla installation?

Thank you for your help.

Cheers,

Marc

IMPACT360
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Re: BLOCK ACCESS IP FROM CHINA

Hi,

We managed to install the dat file. Had to create a file called "geoip" at root of Joomla installation.

We created a module called "Metamod GeoIP" but it doesn't seem to block the website.

Thank you for your help.

Cheers,

Marc

IMPACT360
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Re: BLOCK ACCESS IP FROM CHINA

Hi,

We tried this php code:

if ( $fromCountryId == "CN, TW, IN, NP, TH, BE" )
    $app->redirect("http://www.new.saishopweb.com/");

But we have not been able to make it work.

Cheers,

Marc

IMPACT360
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Re: BLOCK ACCESS IP FROM CHINA

Hi Marc,

You can do this really easily. You got the GeoIP data installed in the right place so that's a good start.

- set "Enable GeoIP/GeoCity" to "GeoIP Country (free or commercial)"
- type CN (or the complete comma-separated list from above) into the "only these countries" box.
- in the PHP box type:

$app = &JFactory::getApplication();
$app->redirect("http://www.new.saishopweb.com/");

Then just make sure that this module is assigned to all the pages that you want to protect.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: BLOCK ACCESS IP FROM CHINA

Thanks!

It works like a charm.

Cheers,

Marc

IMPACT360
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1684
Total Polls:
6
Total Posts:
5940
Posts this week:
1
User Info:
 
Total Users:
5174
Newest User:
frashaomran
Members Online:
0
Guests Online:
195

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked