Search code examples
http-redirectherokudnsurl-routingnameservers

Website has been renamed. How can I redirect subdomain.OldURL.com to subdomain.NewURL.com


The old name was http://cappedin.com.

The new name is http://cappedsports.com

I set up a 301 DNS redirect cappedin.com to cappedsports.com

How can I get a subdomain.cappedin.com to be redirected to the same subdomain.cappedsports with a DNS entry?


Solution

  • Reading DNSimple's docs on their URL redirects, it says:

    The redirector currently doesn’t support redirect targets that include a back-reference (match) to the redirect source. For example, the following redirects will not work:

    *.foo.com to bar.com/$1
    *.foo.com to $1.bar.com
    

    So unfortunately, they don't seem to allow what you are trying to do. You would need to add a URL record for each subdomain you want to redirect, or redirect the wildcard to a single destination domain.

    To reiterate, this is not a "DNS Redirect". It is a http redirection service provided by DNSimple. It works like this:

    1. You add a URL record to your domain in DNSimple.
    2. They add a [hidden to you] A record pointing that name at their own servers.
    3. Their http servers issue 301 redirects to your domain.

    You could cut out the middle man and make a wildcard A for the redirect domain to a server you control that can perform whatever custom 301 logic you wish.