0

I have a domain (first-domain.com) bought with domain.com with no server setup. I want to redirect this domain to another (second-domain.com) while conserving the path.

Example 1: 'first-domain.com/example-path' should redirect to 'second-domain.com/example-path'.

Example 2: 'first-domain.com/example-path-2' should redirect to 'second-domain.com/example-path-2'.

I tried various things in domain settings like setting a pointer and also update CNAME but it's not redirecting with the path conserved, it only redirects to the base url.

The main purpose for me to do this redirection is to set an alias so all my traffic on first domain can be redirect to another and users don't have to enter the full path again.

Ritush
  • 3

1 Answers1

2

The main purpose for me to do this redirection is to set an alias so all my traffic on first domain can be redirect to another and users don't have to enter the full path again.

You need a web server that will send a 301 Redirect header. It can't be solved at the DNS level.

vidarlo
  • 9,165
  • Is there way to do it without a webserver on source DNS (i.e first-domain.com)? I have full access/control on destination DNS and server (i.e second-domain.com) – Ritush Jan 17 '24 at 20:38
  • No, you can't do it in DNS. You need a webserver that can send a 301 redirect. Why not simply set up a new vhost on your webserver to handle it? – vidarlo Jan 17 '24 at 20:53
  • When you say 'simply set up a new vhost on your webserver to handle it'... you mean target server (i.e second-domain.com)? as the source dns don't have a server. If yes, can you please refer me to a link/doc on how to set it up? thanks – Ritush Jan 17 '24 at 22:18
  • If you're using a basic webhost that does everything for you, contact them. – vidarlo Jan 17 '24 at 22:21