NameSilo

Forward URL by region

Spacemail by SpaceshipSpacemail by Spaceship
Watch

jestew

Established Member
Impact
0
If anyone can help me, I'd appreciate it. I have a domain that I'd like to forward to an affiliate site. The only problem is that the affiliate that I am using has different programs for different countries. So, I need to figure out how to forward visitors from different countries to different landing pages.

Thanks in advance.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
0
•••
I couldn't get my hosting service to recognize my .htaccess file.
 
0
•••
Your site might be running under Windows, the information on the site maxmind.com is for Linux based hosting and not Windows. Please check with your hosting company.

You can redirect the user to any URL based upon their IP address.
Ex:

<?
$visitor = $_SERVER['REMOTE_ADDR'];
if (preg_match("/111.111.111.1/",$visitor)) {
header('Location: http://www.affiliateURL');
} else {
header('Location: http://www.affiliateURL-1');
};
?>

Hope the above snippet gives you an idea.

-- Dave.
 
0
•••
murrayd77 said:
Your site might be running under Windows, the information on the site maxmind.com is for Linux based hosting and not Windows. Please check with your hosting company.
You can redirect the user to any URL based upon their IP address.
Ex:
<?
$visitor = $_SERVER['REMOTE_ADDR'];
if (preg_match("/111.111.111.1/",$visitor)) {
header('Location: http://www.affiliateURL');
} else {
header('Location: http://www.affiliateURL-1');
};
?>
Hope the above snippet gives you an idea.
-- Dave.

This code is good but how do you redirect to a country with IP ? I mean you should use only first 2 dights of the IP addresss or something ? lets say you want to redirect traffic from USA, Canada and UK for one place and rest to another place .. How to do it ?

.
 
0
•••
0
•••
Dynadot — .com TransferDynadot — .com Transfer

We're social

Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back