Subdomain with Rails and herokuapp - heroku

I have followed Ryan Bates railscast on subdomains (http://railscasts.com/episodes/123-subdomains-revised) and have my app working perfectly locally.
I have deployed to heroku but am unable to get my subdomains to work. I have read about custom domains, DNS and CNAME records but I don't think this is relevant because all I am trying to do is test straight on heroku what I was testing locally. So instead of accessing myapp.herokapp.com I would like to be able to access m.myapp.herokuapp.com. Currently when I try this I get the error: There is no app configured at that hostname.
Can anyone offer a solution?
UPDATE:
Whoops, I think this is a duplicate: How to create a subsubdomain for an app on heroku: (e.g. sub.myapp.herokuapp.com)

Sub-sub domains aren't possible - you need to be using your own DNS records I'm afraid.

Related

Heroku Custom Domain Not Found (404)

I want an application hosted one heroku to be reachable through the api subdomain.
The issue is that when i reach the website, I get a Not Found error message. Calling the url has no impact on the logs so I know the application is not reached.
By reading other issues on stack overflow, I can see that many people did not properly add the custom subdomain but I don't think that's the issue here. I created the subdomain through heroku's web interface.
If I run this in my terminal
$ heroku domains -a myapp
I get the following result
=== stickyhabitsapi Heroku Domain
myapp.herokuapp.com
=== stickyhabitsapi Custom Domains
Domain Name DNS Record Type DNS Target
api.stickyhabits.app CNAME mydnstarget
The DNS is managed by netlify. With their interface, I created a CNAME pointing to the DNS target supplied by heroku. Any Idea what might have gone wrong ?

GoDaddy domain not pointing to Heroku app

I'm trying to point my GoDaddy domain to Heroku app. I followed the steps given here: https://devcenter.heroku.com/articles/custom-domains#add-a-custom-root-domain but I'm unable to access my Heroku app. Here are my DNS records settings:
Can someone tell me where I'm going wrong?
cname only allow you to point subdomain, so this case you should be able to see www subdomain pointed to Heroku, can you try to remove the A record.
I would recommend using DNS service like DNSimple/Cloudflare or in case you don't want to go out of Heroku you can try pointDNS

Configure CNAME for a heroku app with subdomains

Currently i have an app on Heroku with a wildcard subdomain working like this:
client1.myapp.com, client2.myapp.com, ...
This is working fine.
Then, i'd like that each client can access this apps using their own personal domains. So, testing this on my personal domain, i would like to configure test.mydomain.com like this:
CNAME test --- client1.myapp.com
But, this is not working yet. I keep getting the heroku error 'No such app, There's nothing here, yet.'.
Not sure what i am missing. Is it a problem related to my actual Laravel app? Heroku config? DNS?
Thanks in advance for any help.
Assuming your application will provide an hostname for each client (actually, it would probably be preferable to have a single hostname as in any case it looks like they will all point to the same Heroku app), then you have to complete all these tasks in order to make it work:
Add the subdomain client1.myapp.com as domain attached to the Heroku app
Configure the DNS record for client1.myapp.com
Ensure client1.myapp.com resolves (dig client1.myapp.com)
Add the customer subdomain/domain to your Heroku app, otherwise Heroku will reject routing the requests for that domain
Configure the DNS record for the customer subdomain/domain to CNAME client1.myapp.com
Ensure the customer subdomain/domain resolves
According to your issue description, I assume you probably did not configure the customer subdomain/domain as domain to your Heroku app.

Production redirect loop error on root domain, but not with www

I'd like when a user types the domain YOURSITE.com to not go into a loop and crash. I've searched for answers for a couple days now and can't seem to find the exact one.
Error from chrome: This webpage has a redirect loop - The webpage at http://YOURSITE.com/ >has resulted in too many redirects. Clearing your cookies for this site or allowing third->party cookies may fix the problem. If not, it is possibly a server configuration issue and >not a problem with your computer.
Background:
Rails 3.2.14 App with Ruby 2.0.0
Domain bought with godaddy
Hosting on Heroku with both domains setup www.YOURSITE.com and YOURSITE.com
Using AWS with route 53 and S3.
Let me know what relevant code you need to help or if this is something that is being caused by AWS or the like. I've tried an reversed several different things via my code, but can't seem to find anything that works.
you should log into your Heroku dashboard, click on the app and then click on the "Production Check" button. This will help you check for DNS issues among other.
Check your DNS Zone file with godaddy. How are you redirecting the sub domain www to the host domain?
On your rails app, how is your route.rb file handling the incoming traffic? do you have any redirection there?
Hope that helps..
There is a very good write up that goes through configuration settings between AWS, the domain registrar (in my case godaddy), and heroku here: https://devcenter.heroku.com/articles/route-53#naked-root-domain I used this originally when I set up my site.
I wish I could say I know what the problem was, but I'm not totally sure what it was. My guess is that it had to do with APEX domains being unsupported by AWS and/or Heroku, and therefore I needed not to try to redirect. Here's the settings that worked for me:
Godaddy domain mysite.com, transferred my DNS stuff to AWS (I had done that prior to the problem)
Heroku: you can either use the CL or you can access the settings for your app online. In either situation I set up my domains to be mysite.com and www.mysite.com
AWS: This is a little trickier. You need to make sure the settings for Route 53 and S3 are exactly like in the tutorial link above. Your mysite.com bucket in S3 must redirect to www.mysite.com.
This isn't ideal and there are probably ways to get around this using different companies for hosting/DNS services, but with the Heroku/AWS combo this is what I had to do to stop the redirect loop.

What is the best solution to use a common domain/subdomain with Jekyll on Heroku and other hosting website?

I just moved my personal website to Octopress from Drupal. I am hosting it on Heroku and I really don't like the herokuapp.com domain. I already have myname.com domain which I am planning to use with Heroku now for my main website.
The problem is I have some other websites hosted on my hosting service which use databases and other stuff. They were being accessed by project1.myname.com, project2.myname.com etc. I don't want to move them and have a similar subdomain naming thing to access them.
How can achieve this?
If I'm understanding you correctly, it should be easy to do this with your DNS settings. Simply point the DNS "A" records for "myname.com" and "www.myname.com" to Heroku and leave "project1.myname.com" and "project2.myname.com" pointing to your existing provider.

Resources