E-posta ve URL Yönlendirme
Alan adına gelen postayı ve ziyaretçiyi başka bir adrese gönderen yedi uç.
Genel Bakış
Bu yedi uç alan adına gelenlerin nereye gideceğini belirler. İkisi ayrı iştir: e-posta yönlendirmesi postayı, URL yönlendirmesi ziyaretçiyi başka bir yere gönderir.
E-posta yönlendirmesinde posta kutusu açılmaz; gelen posta olduğu gibi başka bir adrese iletilir. URL yönlendirmesi ise alan adında bir site barındırmadan onu başka bir adrese bağlar.
Referans
E-posta Yönlendirmelerini Listeleme
Alan adına gelen postanın nereye iletildiğini gösteren kayıtları döndürür.
curl 'https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// 'source' hesaplanmis bir alandir; yazarken degil YALNIZ okurken bulunur.
$forwards = Api::Services()->GetDomainEmailForwards(['id' => 520])['data'];{
"data": [
{
"identity": "3001",
"prefix": "info",
"source": "[email protected]",
"target": "[email protected]"
}
]
}E-posta Yönlendirmesi Ekleme
Alan adının bir adresine gelen postayı başka bir adrese iletir.
curl -X POST 'https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"prefix":"info","target":"[email protected]"}'const res = await fetch('https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ prefix: 'info', target: '[email protected]' }),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'prefix' => 'info',
'target' => '[email protected]',
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// On ek YALNIZ yerel kisimdir: tam adres gondermek '[email protected]@example.com' uretir.
Api::Services()->AddDomainEmailForward([
'id' => 520,
'prefix' => 'info',
'target' => '[email protected]',
]);E-posta Yönlendirmesini Güncelleme
Bir yönlendirmenin hedefini değiştirir. Kaynak ön eki değiştirilemez.
target_new olarak gönderdiğiniz değerdir.curl -X PUT 'https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"prefix":"info","target":"[email protected]","target_new":"[email protected]"}'const res = await fetch('https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards', {
method: 'PUT',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
prefix: 'info',
target: '[email protected]',
target_new: '[email protected]',
}),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'prefix' => 'info',
'target' => '[email protected]',
'target_new' => '[email protected]',
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// Ön eki degistirmek icin bu uc yoktur: eskisini silip yenisini eklersiniz.
Api::Services()->DeleteDomainEmailForward(['id' => 520, 'prefix' => 'info']);
Api::Services()->AddDomainEmailForward([
'id' => 520,
'prefix' => 'contact',
'target' => '[email protected]',
]);E-posta Yönlendirmesini Silme
Bir e-posta yönlendirmesini kaldırır.
curl -X DELETE 'https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"prefix":"info"}'const res = await fetch('https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ prefix: 'info' }),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/services/520/domain/email-forwards');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['prefix' => 'info']),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// Ayni on ekte birden cok hedef varsa yalniz on ek gondermek HEPSINI silebilir.
Api::Services()->DeleteDomainEmailForward([
'id' => 520,
'prefix' => 'info',
'target' => '[email protected]',
]);URL Yönlendirmesini Okuma
Alan adının başka bir adrese yönlendirilip yönlendirilmediğini döndürür.
curl 'https://panel.ornek.com/api/v1/admin/services/520/domain/forwarding' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/services/520/domain/forwarding', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/services/520/domain/forwarding');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Services()->GetDomainForwarding(['id' => 520]);URL Yönlendirmesini Ayarlama
Alan adına gelen ziyaretçileri başka bir adrese gönderir.
curl -X PUT 'https://panel.ornek.com/api/v1/admin/services/520/domain/forwarding' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"domain":"example.net","protocol":"https","method":301}'const res = await fetch('https://panel.ornek.com/api/v1/admin/services/520/domain/forwarding', {
method: 'PUT',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
domain: 'example.net',
protocol: 'https',
method: 301,
}),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/services/520/domain/forwarding');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'domain' => 'example.net',
'protocol' => 'https',
'method' => 301,
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// Kalici yonlendirme tarayicilarda onbellege alinir: gecici deneme yapiyorsaniz 302 secin.
Api::Services()->SetDomainForwarding([
'id' => 520,
'domain' => 'example.net',
'protocol' => 'https',
'method' => 302,
]);URL Yönlendirmesini Kaldırma
Yönlendirmeyi kaldırır ve alan adını kendi ad sunucularına bırakır.
curl -X DELETE 'https://panel.ornek.com/api/v1/admin/services/520/domain/forwarding' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/services/520/domain/forwarding', {
method: 'DELETE',
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/services/520/domain/forwarding');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// Yonlendirmeyi kaldirmak alan adini ad sunucularina birakir; DNS kaydi yoksa site acilmaz.
Api::Services()->CancelDomainForwarding(['id' => 520]);
$records = Api::Services()->GetDnsRecords(['id' => 520])['data'];Tuzaklar
Kaynak adresi alan adıyla birlikte göndermeyin: uç ön eke alan adını kendisi ekler. Tam adres gönderirseniz iki kez eklenmiş bir kaynak oluşur ve yönlendirme hiçbir zaman eşleşmez. Okurken gördüğünüz tam adres hesaplanmış bir alandır; yazarken kullanılmaz.
Silme ucunda yalnız ön ek zorunludur. Aynı ön ekte birden çok hedef varsa hedefi ya da kimliği vermeden gönderilen istek hepsini kaldırabilir, çünkü eşleşmeyi modül yapar. Tek bir kaydı silecekseniz hedefi de gönderin.
Güncelleme ucu yalnız hedefi değiştirir. Kaynak adresi değiştirmek için kaydı silip yenisini eklemeniz gerekir; arada gelen posta hiçbir yere iletilmez.
Varsayılan yönlendirme tipi kalıcıdır ve tarayıcılar bunu önbelleğe alır. Yanlış bir hedefe kalıcı yönlendirme koyup sonra düzeltirseniz, daha önce ziyaret etmiş kullanıcılar bir süre eski hedefe gitmeye devam eder. Denerken geçici tipi seçin.
Yönlendirme kaldırıldığında alan adı kendi ad sunucularına döner. O sunucularda bir kayıt yoksa alan adı hiçbir yere çıkmaz: önceden yönlendirme kullanıldığı için DNS kaydı hiç yazılmamış olabilir. Kaldırmadan önce kayıtlara bakın.
İlgili Makaleler
Geri bildiriminiz için teşekkürler!
Yukarıda bulamadığınız her şey için destek ekibimiz her zaman yanınızda.