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.

 

Geo/IP redirect exclude IP

Geo/IP redirect exclude IP

Hi,

We are using a Chameleon rule to redirect visitors depending on their country IP address. What is the best way to exclude certain IP addresses from this rule?

Thanks

Mike

designbuilder
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Geo/IP redirect exclude IP

Hi, that's a good question.
You can do that in the PHP tab of the Chameleon rule, and return false if the IP address matches.

e.g.

$excludes = array(
"1.2.3.4",
"1.2.3.5",
"101.102.103.104"
);

$ip = comChameleonHelper::getUserIP();
if (in_array($ip, $excludes)) return false;

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: Geo/IP redirect exclude IP

Hi,

Thank you, this is working well.

Regards

Mike

designbuilder
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1698
Total Polls:
6
Total Posts:
5944
Dormant:
User Info:
 
Total Users:
5595
Newest User:
gary099231
Members Online:
1
Guests Online:
544

Online: 
gary099231

Forum Legend:

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