You would need to make sure that a server (doesn't have to be the SharePoint server) responds to example.com
.
On that server, you could use a redirection technique. If using IIS, you can configure a 301 (permanent) redirect, from http://example.com
-> https://www.xxxx.com
.
Using IIS Manager, go to Sites -> the site responding to http://example.com
, then go into HTTP Redirect. Enter an address to redirect to (https://www.xxxx.com
) and select a status code of "Permanent (301)".
This is the easiest way to do this. Another option would be using IIS Redirect. An example can be found at http://blogs.msdn.com/b/kaushal/archive/2013/05/23/http-to-https-redirects-on-iis-7-x-and-higher.aspx.