debug mode : replaced substr() by parse_url() in order to get the domain name in a proper way