I have a column in my database for website URL and there are many different types of results. Some with www, some with http:// and some without.
I really need to clean up the field, so is there a query I can run to:
- Replace all domains with just domain.com format. So remove any www or http://'s
- If there is any fields with invalid format like "N/A" or something, so anything without a "." I need to empty it.
And then of course I will update my PHP code to automatically strip it from now on. But for the current entries I need to clean those up.
www.example.comandexample.comare different hostnames, can resolve to different IPs, and can be handed by different virtual hosts (over HTTP) even if they resolve to the same IP. Assuming that they are the same is unwise.