Added check to prevent redirecting to non-domain URL

Actually works this time