Proper check for http and https (otherwise domains starting with "http" would break the code)