I’m creating an application in PHP5 that needs to store a unique URL for a website. For example, if a user enters “http://www.google.com/” I’ll store it in the DB as “google.com” after parsing it. Basically I need a consistent convention for URLs so that there aren’t multiple entries for the same site.
Basically, is it OK to be taking the “www” off of all URLs entered? Or should I keep it?
Although the distinction won’t always matter, http://www.google.com refers to a different DNS entry than google.com, and might conceivably return different data. You see www2.foo.com in the wild occasionally, for instance, and foo.com might redirect to it for strange load-balancing reasons.
So, bad idea.