Handling complicated URLs and HTTPS