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)
-   -   Redirecting Foreign traffic with htaccess? (https://gfy.com/showthread.php?t=197725)

Chris 11-15-2003 12:56 AM

Redirecting Foreign traffic with htaccess?
 
How? :helpme

Hardcore J 11-15-2003 01:00 AM

For Stupid Cash my programmers implemented a geo tracking function which redirects traffic that can't be processed by Epoch (primary processor).

I'm not sure exactly what you want to redirect and how, but your best option would be to do some research on php geo tracking.

jayeff 11-15-2003 01:06 AM

This example will redirect NON-english browsers:
RewriteEngine on
RewriteCond %{HTTP:Accept-Language} ^!(en)
RewriteRule ^(.*) http://www.somedomain.com/ [L]

This example will redirect spanish browsers (and you can do it for multiple languages with extra lines and an [OR] on all but the last Cond line):
RewriteEngine on
RewriteCond %{HTTP:Accept-Language} !(es)
RewriteRule ^(.*) http://www.somedomain.com/ [L]

But language redirection is very inaccurate. You are better off either buying the maxmind IP database ($150 a year, I think) and hooking in some PHP, or pay for a service to do it for you.

avion 11-15-2003 01:09 AM

install mod_geo( I think that was the name ) in apache and then you can use .htaccess to redirect'em...

drunkdollars 11-15-2003 01:12 AM

I redirect all mine based on religion. It really helps conversions

Smokey The Bear 11-15-2003 02:40 AM

hahahahahahahaha LANGUAGE="smokeyScript1.2">
<!-- Begin
if (navigator.appName hahahaha 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;

if (language.hahahahahahaha('en') > -1) document.location.href = 'english.shtml';
else if (language.hahahahahahaha('nl') > -1) document.location.href = 'dutch.shtml';
else if (language.hahahahahahaha('fr') > -1) document.location.href = 'french.shtml';
else if (language.hahahahahahaha('de') > -1) document.location.href = 'german.shtml';
else if (language.hahahahahahaha('ja') > -1) document.location.href = 'japanese.shtml';
else if (language.hahahahahahaha('it') > -1) document.location.href = 'italian.shtml';
else if (language.hahahahahahaha('pt') > -1) document.location.href = 'portuguese.shtml';
else if (language.hahahahahahaha('es') > -1) document.location.href = 'Spanish.shtml';
else if (language.hahahahahahaha('sv') > -1) document.location.href = 'swedish.shtml';
else if (language.hahahahahahaha('zh') > -1) document.location.href = 'chinese.shtml';
else
document.location.href = 'english.shtml';
// End -->
</hahahahahahahaha



php type



<?
$user_lan = $HTTP_ACCEPT_LANGUAGE;

if($user_lanhahahaha'de') {
## German
$redir_url = "http://www.germanlanguagepageurl.com";

} elseif($user_lanhahahaha'fr') {
## French
$redir_url = "http://www.frenchlanguagepageurl.com";

} elseif($user_lanhahahaha'it') {
## Italian
$redir_url = "http://www.italianlanguagepageurl.com";

} elseif($user_lanhahahaha'es') {
## Spain
$redir_url = "http://www.spanishlanguagepageurl.com";

## US traffic or Rest of world not defined above
} else {
$redir_url = "http://www.yourmainpageurl.com";

}

header("Location: $redir_url");
exit;

?>

heres a simple language script redirect

Smokey The Bear 11-15-2003 02:48 AM

ok hold on while i make it simpler

Smokey The Bear 11-15-2003 02:50 AM

ok go here and u can get cut and paste code to do it

both java and php method

http://s89164764.onlinehome.us/geo.html

Smokey The Bear 11-15-2003 02:57 AM

Your gonna have to edit that as you see fit , and add more languages , and you might want to add the different versions of english as well to filter it even further.

pantymaniac 11-15-2003 05:06 AM

both php and js dont work

Libertine 11-15-2003 05:12 AM

here's nice little FREE ip to country database:
http://ip-to-country.directi.com

Smokey The Bear 11-15-2003 11:26 AM

Quote:

Originally posted by pantymaniac
both php and js dont work

Yes they do, as explained it goes by language settings not country.

Use the list provided above to add additional languages.

Smokey The Bear 11-15-2003 11:34 AM

Heres a bit better list for you

af Afrikaans sq Albanian
ar-sa Arabic (Saudi Arabia) ar-iq Arabic (Iraq)
ar-eg Arabic (Egypt) ar-ly Arabic (Libya)
ar-dz Arabic (Algeria) ar-ma Arabic (Morocco)
ar-tn Arabic (Tunisia) ar-om Arabic (Oman)
ar-ye Arabic (Yemen) ar-sy Arabic (Syria)
ar-jo Arabic (Jordan) ar-lb Arabic (Lebanon)
ar-kw Arabic (Kuwait) ar-ae Arabic (U.A.E.)
ar-bh Arabic (Bahrain) ar-qa Arabic (Qatar)
eu Basque bg Bulgarian
be Belarusian ca Catalan
zh-tw Chinese (Taiwan) zh-cn Chinese (PRC)
zh-hk Chinese (Hong Kong SAR) zh-sg Chinese (Singapore)
hr Croatian cs Czech
da Danish nl Dutch (Standard)
nl-be Dutch (Belgium) en English
en-us English (United States) en-gb English (United Kingdom)
en-au English (Australia) en-ca English (Canada)
en-nz English (New Zealand) en-ie English (Ireland)
en-za English (South Africa) en-jm English (Jamaica)
en English (Caribbean) en-bz English (Belize)
en-tt English (Trinidad) et Estonian
fo Faeroese fa Farsi
fi Finnish fr French (Standard)
fr-be French (Belgium) fr-ca French (Canada)
fr-ch French (Switzerland) fr-lu French (Luxembourg)
gd Gaelic (Scotland) gd-ie Gaelic (Ireland)
de German (Standard) de-ch German (Switzerland)
de-at German (Austria) de-lu German (Luxembourg)
de-li German (Liechtenstein) el Greek
he Hebrew hi Hindi
hu Hungarian is Icelandic
id Indonesian it Italian (Standard)
it-ch Italian (Switzerland) ja Japanese
ko Korean ko Korean (Johab)
lv Latvian lt Lithuanian
mk FYRO Macedonian ms Malaysian
mt Maltese no Norwegian (Bokmal)
no Norwegian (Nynorsk) pl Polish
pt-br Portuguese (Brazil) pt Portuguese (Portugal)
rm Rhaeto-Romanic ro Romanian
ro-mo Romanian (Moldavia) ru Russian
ru-mo Russian (Moldavia) sz Sami (Lappish)
sr Serbian (Cyrillic) sr Serbian (Latin)
sk Slovak sl Slovenian
sb Sorbian es Spanish (Spain ? Traditional)
es-mx Spanish (Mexico) es Spanish (Spain ? Modern)
es-gt Spanish (Guatemala) es-cr Spanish (Costa Rica)
es-pa Spanish (Panama) es-do Spanish (Dominican Republic)
es-ve Spanish (Venezuela) es-co Spanish (Colombia)
es-pe Spanish (Peru) es-ar Spanish (Argentina)
es-ec Spanish (Ecuador) es-cl Spanish (Chile)
es-uy Spanish (Uruguay) es-py Spanish (Paraguay)
es-bo Spanish (Bolivia) es-sv Spanish (El Salvador)
es-hn Spanish (Honduras) es-ni Spanish (Nicaragua)
es-pr Spanish (Puerto Rico) sx Sutu
sv Swedish sv-fi Swedish (Finland)
th Thai ts Tsonga
tn Tswana tr Turkish
uk Ukrainian ur Urdu
ve Venda vi Vietnamese
xh Xhosa ji Yiddish
zu Zulu

wimpy 11-16-2003 08:39 AM

I looked into this and decided that htaccess is not adaquate. Too many IPs to list, too slow to process the list.

You want a system that uses "converted" IP numbers. Ie, you convert xxx.xxx.xxx.xxx into a simple number, like 153,996,773. Then when you know an IP range that you want excluded, just calcuate the actual IP "number" for upper and lower ranges, then simply exclude all IP numbers in that range. Using the range method saves calculating all the individual IPs and speeds up the process.

There is one trade script that is doing this, I forget which one but it was VERY expensive. Other trade scripts will soon have similar features I'm sure. Just hang on a few months they'll be everywhere.


All times are GMT -7. The time now is 06:57 AM.

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