Reputation: 1
I need to redirect a website visitor to a different file on my site if they come from the same IP within the last 24 hours.
For example user 1 visits my website from IP 34.56.22.222 and he goes right to the index.php (home page).
But then he refreshes the page or comes back to the site within a 24 hour period. In that case I'd like him to be redirected to index1.php.
Is there anyway this can be done with .htaccess?
Upvotes: 0
Views: 95
Reputation: 11
you can set a cookie for 24 hrs on the visitors site and check in the request if cookie exists then redirect him to the index1.php (this will be checked on client browser level not on ip level), If you want to have a check on ip level then you should set a flag value in redis or wherever you want with TTL of 24 hrs and whenever a new request comes check the flag for client ip, if it exists redirect to index1.php I don't know any way of doing this from .htaccess
Upvotes: 1