Check if two urls are for the same website
问题 I'm looking for a way to compare two urls. I can do: URI('http://www.test.com/blabla').host to have the base name, but this not reliable. For example: URI('http://www.test.com/blabla').host == URI('http://test.com/blabla').host returns false , but they can be the same site. To have the IP address is not reliable too because if I do: IPSocket.getaddress(URI('http://hello.herokuapp.com').host) == IPSocket.getaddress(URI('http://test.herokuapp.com').host) It returns true , but they are not the