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.

 

[solved] Geo Redirect depends of country of user

[solved] Geo Redirect depends of country of user

Hello,

We are running Joomla 2.5 and installed Chameleon 2.36. I have installed the GeoLite country database from you config area of the component. Then I made a rule that  If user is from Ecuador redirect to url: http://190.57.145.46/volrisk2/ec/, but If user is from another country, example  Colombia, USA redirect to url: http://190.57.145.46/volrisk2/

Config: GeoIP Country
Quick Rules:
-Only These Countries: ec

Actions:
-Succeed Actions:
--Next action: redirect...
--redirect page: ignore
--redirect url: http://190.57.145.46/volrisk2/ec/

Fail Actions:
--Next action:redirect
--redirect page: ignore
--redirect url: http://190.57.145.46/volrisk2

However no matter if the user is the Ecuador, the redirect does not take place.
Please help me, What am I doing bad?

anaromero
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: [solved] Geo Redirect depends of country of user

Hi anaromero,
I wonder if your IP address is not being detected correctly? Look up you IP address using google "what's my IP address" then put that into the tester at www.maxmind.com to see what it comes up with.

If that's not the issue, then try putting the IP address 201.218.13.85 (which MaxMind definitely treats as from EC) into the IP address override box in the Chameleon Options panel. While you're at it, turn on Chameleon Debug mode. Then view the front end of the site and see what Chameleon reports. Hopefully it will tell you that it's detecting EC, then what rules it's trying and the actions it's performing. You may find it's just the logic of the rules that's tripping you up.

Don't forget to remove the IP address from the Override options panel when you're done, as this override will affect everyone on the site no matter where they are from.

Hope that helps,
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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: [solved] Geo Redirect depends of country of user

Hello Stephen,

I did do what you said to me.
I did put the Ip 201.218.13.85  into the IP address override box in the Chameleon Options panel. Enable on Chameleon Debug mode and acontinuación I go the front of the site and see what that tells Chameleon.

The funny thing was that by putting the IP, the rule worked correctly. After 3 tests came out debugging and this is what it give:

CAMELEON DEBUG ON
Current date and time: "7/30/2014 21:31:29 pm" in timezone "UTC"
Processing rule id 4 ("Change country according content detected")
- GeoIP: enabled
- GeoIP Country id: GB
- GeoIP Country name: United Kingdom
- GeoIP Country "GB" is not in the include list
Started FAIL action for rule id 4
Finished FAIL action: default template style not changed
Exiting system as result of rule rule rule FAIL at id 4 (Change content detected according to country)
Final template style unchanged
CHAMELEON DEBUG ON
Current date and time: "7/30/2014 21:06:14 pm" in timezone "UTC"
Processing rule id 4 ("Change country according content detected")
- GeoIP: enabled
- GeoIP Country id: EC
- GeoIP Country name: Ecuador
- GeoIP Country "EC" is in the include list
Started SUCCEED action for rule id 4
- Loading plugin group "authentication"
- Removing plugin "plgauthenticationjoomla"
* Redirecting to ec

When removed the IP and disable debugging Chameleon no longer works. The redirection is not performed.
Please help me, what am I doing wrong?

anaromero
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: [solved] Geo Redirect depends of country of user

Hi,

GB is the default country that appears if Chameleon (or actually the MaxMind database) can't find your local IP address. Can I ask, is your server in the same local domain (e.g. behind NAT) as your PC? That is, if the server can't see your external IP address then it will think that you are in GB unless you use the override.

One way to find this out is to create a new Chameleon rule and order it first in the list of rules. In the PHP box, enter the following:

echo "IP address is: " . $core_genius->info("clientip"));

Then view a page on the front end and take a note of what it says the IP address is. Is it a 192.168 or 10.10 address? If so, you would need to test it from an internet connection that's "external" to the server.

Hope that helps,
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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: [solved] Geo Redirect depends of country of user

Thanks for the help
By placing my web page in the hosting, my problem was solved. Everything is working properly.
The support given, me served much.

anaromero
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10796
Newest User:
mokao3
Members Online:
0
Guests Online:
174

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