function to check if url exists

this functions check if a url exist or not and returns true or false
accordingly