Fixed URL parsing to include subdomains with special characters