GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Advanced Geo Mobile Redirect script? (https://gfy.com/showthread.php?t=1058723)

cybermike 02-23-2012 12:38 PM

Advanced Geo Mobile Redirect script?
 
There are a lot of different ways to monetize mobile and here is what I want to do but it seems too complicated.

All Mobile users will get redirected

US + Canada redirect to URL1,URL2,URL3 etc at random
Germany will go to URL A, URL B
France URL C
Russia URL D
Argentina URL E
etc
THE REST URL F

The ones I find online are the basic if US/Canada go to URL A ALL ELSE go to URL B

Klen 02-23-2012 12:39 PM

I have it.

cybermike 02-23-2012 12:42 PM

Quote:

Originally Posted by KlenTelaris (Post 18777027)
I have it.

Clap clap

AHarper 02-23-2012 01:15 PM

Quote:

Originally Posted by KlenTelaris (Post 18777027)
I have it.

Good reply, very useful information :error

Klen 02-23-2012 01:28 PM

Quote:

Originally Posted by cybermike (Post 18777034)
Clap clap

Thanks ;)

Fletch XXX 02-23-2012 01:32 PM

Sounds yummy

fuzebox 02-23-2012 01:36 PM

Pretty basic php once you've got the maxmind country lite db...

Showman 02-23-2012 03:40 PM

ip2nation.com - this should do the trick

NemesisEnforcer 02-24-2012 02:18 AM

Quote:

Originally Posted by Showman (Post 18777432)
ip2nation.com - this should do the trick

Are you currently using this?

Klen 02-26-2012 05:42 AM

Quote:

Originally Posted by Showman (Post 18777432)
ip2nation.com - this should do the trick

Their database is incorrect,if you want correct database maxmind geo ip is must have.

Varius 02-26-2012 06:03 AM

Doing it at the script (PHP, etc...) level is easy, however you probably want the webserver to handle that instead...assuming you use Apache, the key directive you will need is for the randomness: RewriteMap

Example:

let's say you create /my/dir/de_map.txt and it contains this line:

dynamic url1|url2 (as many as you like)

Here could be your Germany for example redirect section:

RewriteMap servers rnd:/my/dir/de_map.txt
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^DE$
RewriteRule ^(.*)$ http://${servers:dynamic}/$1 [P,L]

Of course, you should have your conditions to check whether it's mobile or not as well before that stuff, and make sure MaxMind mod_geoip is installed.

Note: Since its 5am here and Im just tossing this out quick from memory, you may wish to double-check the syntax :winkwink:


All times are GMT -7. The time now is 10:43 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123