-3

A given client needs to point a domain to my IP address. The problem is that when accessing through this subdomain it needs to "drop" at a certain URL.

For example:

sub.domainofmyclient.com => mydomain.com/foo/bar

How can I achieve this?

PS: Server is VPS with Apache (with WHM/cPanel).

Humberto Castellon
  • 849
  • 1
  • 7
  • 17
Marco Garcia
  • 101
  • 1
  • 2
    Possible duplicate of [How to use DNS/Hostnames or Other ways to resolve to a specific IP:Port](https://serverfault.com/questions/74362/how-to-use-dns-hostnames-or-other-ways-to-resolve-to-a-specific-ipport) – poige Oct 11 '18 at 14:57
  • Possible duplicate of [Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About Mod\_Rewrite Rules but Were Afraid to Ask](https://serverfault.com/questions/214512/redirect-change-urls-or-redirect-http-to-https-in-apache-everything-you-ever) – kasperd Oct 11 '18 at 22:48

1 Answers1

1

This seems to be a job for a HTTP redirection. You can't do that with DNS.

See the Apache Redirect and Rewrite modules. You will need external redirects.

RalfFriedl
  • 3,008
  • 4
  • 12
  • 17