Fix http redirect and remove unsed $domain cache