![]() |
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 |
I have it.
|
Quote:
|
Quote:
|
Quote:
|
Sounds yummy
|
Pretty basic php once you've got the maxmind country lite db...
|
ip2nation.com - this should do the trick
|
Quote:
|
Quote:
|
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