Subdomain to subdomain gerok

I have a heroku app, let's call it showering-wind-33 . I purchased a top-level domain, called example.com and correctly configured my domain to render content to a hero, adding a CNAME pointing to showering-wind-33.herokuapp.com . So when I visit example.com , it displays content from showering-wind-33.herokuapp.com .

I have another foo.com domain and I want store.foo.com point to the contents in store_for_foo.example.com and I am having problems with this.

I tried: 1. Adding a CNAME record in my DNS to point store.foo.com to store_for_foo.example.com 2. Adding store.foo.com to โ€œDomainsโ€ under โ€œSettingsโ€ in my heroku application.

But as a result store.foo.com ends with example.com , but not store_for_foo.example.com

What am I doing wrong? Any help would be appreciated - thanks! How can I get the contents of store.foo.com to show store_for_foo.example.com

+4
source share
1 answer

It cannot be done with pure DNS, but there are several alternatives:

  • Use example.com/store and redirect the store.foo.com URL.

  • Use some kind of middleware to connect these requests only in this domain.

  • Remind your husband that he wrote a book containing a section on DNS, and he should know that;).

+7
source

Source: https://habr.com/ru/post/1486419/


All Articles