The correct way of comparing URLs
When comparing URLs they should not only be compared as strings. URLs hold a structure and data. All aspect of URLs such Encoding, Protocol, Port, Path, Query string content must be looked at. Two URLs that do not match when compared as string can carry the same data.
Read More