imporve get current domain name and protocol