Forums / General Questions / redirect category based on country

redirect category based on country

Views: 596

Results 1 to 2 of 2
31 May 2011, 8:03 AM
#1
vazvi avatar

vazvi

New Zenner

Join Date:
Jan 2011
Posts:
15
Plugin Contributions:
0

redirect category based on country

Hi,

Is this possible,
I have multiple categories in my site,
i have 1 category that i want to when clicked go to a different page based on the country
example, if someone clicks on this category from australia, i want them to see everything within that category
BUT if they click on it from any other country i want them to see a page saying something like "not available in your country"
and not display any of the products

I only want this for the 1 category

i have this code that i had as an example from someone else (i have used maxmind geoip)
(needs some mods that i will do)

but im not sure where to put it?
and if it is possible at all for only 1 category?
any ideas?

<?php require_once("geoip/geoip.inc"); $gi = geoip_open("geoip/GeoIP.dat",GEOIP_STANDARD); $country_code = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']); geoip_close($gi); if($country_code == 'AU') { header('Location: <http://www.example.net/products/1/'%29;> } else { header('Location: <http://www.example.net/products/2/'%29;> } ?>
31 May 2011, 8:08 AM
#2
vazvi avatar

vazvi

New Zenner

Join Date:
Jan 2011
Posts:
15
Plugin Contributions:
0

Re: redirect category based on country

forgot to add,
the reason i want to do this is because i am having issues with people overseas copying my designs,
so i dont want them to see any of my new work, which i will place in this new category
but i still want to sell my older work to these countries, which will be in the other categories