İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

Ülkeye Göre Sayfa Açma

muratozcirpici

0
İyinet Üyesi
Katılım
9 Eylül 2004
Mesajlar
1,324
Reaction score
0
Konum
Adana
Selam ;

yapacağım site de ülke ayrımı yapmasını istiyorum.
yani tr ip den biri girdiği zaman tr/index.asp ye yönlenecek.
diğer bütün dünyadan girenlerde ise en/index.asp ye yönlenecek.

asp sistemi altında olacak yani php yok :)

bunu nasıl yapacam? acil yardım....
 

yoktur

0
İyinet Üyesi
Katılım
28 Ekim 2004
Mesajlar
2,366
Reaction score
1
Konum
/etc/istanbul.c
Ben phpsini yazayım sen asp ye uyarla :p

<?php
if(strstr($HTTP_ACCEPT_LANGUAGE,"en")) {
Header("Location: http://www.site.com/site");
}
elseif(strstr($HTTP_ACCEPT_LANGUAGE,"en-us")) {
Header("Location: http://www.site.com/site");
}
elseif(strstr($HTTP_ACCEPT_LANGUAGE,"de")) {
Header("Location: http://www.site.com/de/");
}
elseif(strstr($HTTP_ACCEPT_LANGUAGE,"tr")) {
Header("Location: http://www.site.com/site/turkce/");
}
elseif(strstr($HTTP_ACCEPT_LANGUAGE,"it")) {
Header("Location: http://www.site.com/site/Italiano/");
}
elseif(strstr($HTTP_ACCEPT_LANGUAGE,"es")) {
Header("Location: http://www.site.com/site/spain/");
}
elseif(strstr($HTTP_ACCEPT_LANGUAGE,"fr")) {
Header("Location: http://www.site.com/site/Fran%c3%a7ais/");
}
else {Header("Location: http://www.site.com/site");
}
?>
 

oyuncu

0
İyinet Üyesi
Katılım
30 Ekim 2002
Mesajlar
602
Reaction score
1
ip bazlı daha iyi sonuç verir, öncelikle ip kontrol edecek türk ipsi değilse TR lang kontrolü ile yabancı ülkedeki türkleride alacak
 

muratozcirpici

0
İyinet Üyesi
Katılım
9 Eylül 2004
Mesajlar
1,324
Reaction score
0
Konum
Adana
sağolun arkadaşlar...

asp ye nasıl uyarlicaz şimdi :)

yoktur senin verdiğini şöyle kullanırız.

<?php
if(strstr($HTTP_ACCEPT_LANGUAGE,"tr")) {
Header("Location: http://www.site.com/tr/index.asp");
}
else {Header("Location: http://www.site.com/en/index.asp");
}
?>

Bu şekilde yapınca herhalde dili türkçe olanlar tr ye giriyor diğerleri en e girmiş oluyor..
şimdi sıra geldi bunu asp yapmaya :) hadi bakalım bunu kim yapabilir ?
 

yoktur

0
İyinet Üyesi
Katılım
28 Ekim 2004
Mesajlar
2,366
Reaction score
1
Konum
/etc/istanbul.c
ip aralıgı tabiki daha iyi ama çok geniş bir ip dilim aralığı var boşuna cpu tüketimi yapar. $HTTP_ACCEPT_LANGUAGE çok daha mantıklı
 

yoktur

0
İyinet Üyesi
Katılım
28 Ekim 2004
Mesajlar
2,366
Reaction score
1
Konum
/etc/istanbul.c
walla yardım etmek isterdim ama beynimin asp kısmına format çektim.
14 satır asp kodu ile yaptıgım şeyi tek satır php ile yapabildigimi ögrendigim gün formatı bastım asp ye :p
3 senedir asp ile ilgilenmiyorum
i love you PHP
 

ShadowSong

0
İyinet Üyesi
Katılım
18 Mayıs 2004
Mesajlar
0
Reaction score
0
Konum
Khalimdor
Söylediğin şekilde ip aralığına değilde browser diline göre yönlendirme olsa daha iyi olur diye düşünüyorum bende ama asp yorumlamak yerine çok kolay bir java ile bu işi halledebilirsin. (ASP yorumlamıyorum çünki session tagı açıyor ve yönlendirilen sayfada inc yada DB bağlantısı varsa sayfanın geç açılmasına yol açıyor.)


Kod:
<!-- ONE STEP TO INSTALL LANGUAGE:

  1.  Copy the coding into the HEAD of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>

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

/*-------------------------------------------------------------
Netscape instructions:  
In Netscape, find the language you want to redirect by going to

Edit Menu --> Preferences...

Then click the '+' box next to 'Navigator' and click 'Languages'
Click 'Add' then find the languages you want and add them below.

---------------------------------------------------------------

Microsoft Internet Explorer instructions:  
In MSIE, find the language you want to redirect by going to

Tools Menu --> Internet Options...

Then click the 'Languages' button near the bottom of the page.
Click 'Add' then find the languages you want and add them below.

-------------------------------------------------------------*/

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

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size:  1.95 KB -->
 

sitemedya

0
İyinet Üyesi
Katılım
11 Kasım 2004
Mesajlar
284
Reaction score
0
muratozcirpici' Alıntı:
sağolun arkadaşlar...
asp ye nasıl uyarlicaz şimdi :)
bu şekilde... :)
Kod:
response.buffer=true ' <-- bu satır kod sayfasının en üstünde olmalı
ulkekodu = request.servervariables("HTTP_ACCEPT_LANGUAGE")
select case ulkekodu
	case "en": link="link_en.asp"
	case "en-us": link="link_enus.asp"
	case "de": link="link_de.asp"
	case "tr": link="link_tr.asp"
	case "it": link="link_it.asp"
	case "es": link="link_es.asp"
	case "fr": link="link_fr.asp"
	case else link="link_nop.asp"
end select
response.redirect link ' ilgili sayfaya yonlendirme yapılması için
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Backlink ve Tanıtım Yazısı için iletişime geçmek için Skype Adresimiz: .cid.1580508955483fe5

Üst