Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subdomain to heroku subdomain

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

I have another domain foo.com and I want store.foo.com to point to a the content in store_for_foo.example.com, and I'm having problems doing 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 app.

But the result is that store.foo.com ends up pointing to example.com but not store_for_foo.example.com

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

like image 952
Ruby Ku Avatar asked Mar 24 '23 13:03

Ruby Ku


1 Answers

Can't be done with pure DNS, but there are some alternatives:

  1. Use example.com/store, and have store.foo.com URL redirect to that.

  2. Use some sort of middleware to pipe those requests on that domain only.

  3. Remind your husband that he has written a book containing a section on DNS and he should know this ;).

like image 83
Neil Middleton Avatar answered Apr 05 '23 16:04

Neil Middleton