improve redirect to support ttl