Merhaba arkadaşlar. sitemi yönlendiriyorum ama istiyorumki her kullanıcıyı günde 1 defa yönlendirsin. bunu nasıl yapabilirim?
"setTimeout(function(){ window.location = "https://r10.net.com"; },3000); "
Bunu yerel depolama ile yapman işini kolaylaştırır.
Örneğin;
const redirectKey = "lastRedirectDate";
// SOn yönlendirilme tarihini yerel depolamadan al
const lastRedirectDate = localStorage.getItem(redirectKey);
const today = new Date().toISOString().split("T")[0];
// Kullanıcının son yönlendirilme tarihi bugün değilse yönlendirme işlemi yaptır
if (lastRedirectDate !== today) {
const redirectUrl = "https://r10.net";
// son yönlendirdiği tarihi bugün olarak güncelle
localStorage.setItem(redirectKey, today);
// ve kullanıcıyı yönlendir
window.location.href = redirectUrl;
}