I am looking to allow my users to use their own domain name to access my web service.
For example if I have a user with a profile at example.com/users/david how can I a
Your issue can be solved with URL rewrite and HTTP Header manipulation or reverse-proxy.
The directive ProxyPassReverse lets Apache adjust the URL in the Location header on HTTP redirect responses. For instance this is essential when Apache is used as a reverse proxy to avoid by-passing the reverse proxy because of HTTP redirects on the backend servers which stay behind the reverse proxy.
Suppose the local server has address http://wibble.org/; then
ProxyPass /mirror/foo/ http://foo.com/
ProxyPassReverse /mirror/foo/ http://foo.com/will not only cause a local request for the http://wibble.org/mirror/foo/bar to be internally converted into a proxy request to http://foo.com/bar (the functionality ProxyPass provides here). It also takes care of redirects the server foo.com sends: when http://foo.com/bar is redirected by him to http://foo.com/quux Apache adjusts this to http://wibble.org/mirror/foo/quux before forwarding the HTTP redirect response to the client.
Easily replace Web application URLs to produce user and search engine >friendly results. URL Rewrite permits Web administrators to easily replace the URLs >generated by a Web application in the response HTML with a more user friendly and search engine friendly equivalent. Links can be modified in the HTML markup generated by a Web application behind a reverse proxy. URL Rewrite makes things easier for outbound response content and headers rewriting with outbound rewrite rules that work with HTTP request and response headers and with IIS server variables.
Additionaly, you must make sure that exampledavid(dot)com is setup with DNS provider to pass all requests to example.com.
DNS Record Sample:
NAME TYPE VALUE
--------------------------------------------------
exampleXYZ.com. CNAME example.com.
example.com. A 192.0.2.23
Ref:
https://en.wikipedia.org/wiki/CNAME_record
http://www.akadia.com/services/apache_redirect.html
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
http://www.iis.net/downloads/microsoft/url-rewrite