heroku deployment - issue with www - django

I have deployed my django app "myapp" to myapp.herokuapp.com
I own a domain www.example.com with godaddy
I have setup CNAME in my godaddy domain (www.example.com) to point to myapp.heroku.com
I have also added example.com and www.example.com as custom domains to my heroku app.
But, as of now, I am getting the app only at www.example.com and not at example.com(without www)
www.example.com gives me the default godaddy parked page.
What is the issue? How can I solve this?

It is not possible to set a CNAME for the root example.com.
Even if it were possible, you probably wouldn't want to do it, since it would be saying "use the mail settings for myapp.heroku.com for example.com.
You would usually just set an A record for the root domain, but this is not possible because of heroku's dyamic routing.
The heroku docs suggest that you set an ALIAS or ANAME record (these are custom record types, dependent on your DNS provider), or set up a subdomain redirection from example.com to www.example.com See the root domain section of the custom domains page on the heroku devcenter for more info.

Related

How to redirect www.example.com to example.com in route53 aws?

I have setup record in route53 for example.com to point to my cloudfront distribution(serves all the static files). I want browser to redirect to example.com if user goes to www.example.com. I could point www to same cloudfront distribution, but then browser treats both these domains as seperate sites. They use different local browser cache and all. I want them to use same local cache.
I found the answer myself after lot of research. Point www to a s3 endpoint configured to redirect to example.com. Refer this article for more info.
Also, I am now using google domains instead of route 53 because it has inbuilt option to redirect subdomain.

Is it possible to redirect a subdomain to a different domain (behind CloudFront distribution)?

We own two different domains and manage them in Route 53, to keep things simple I'll refer to them as example.com and secondary.com. Originally we had three CloudFront distributions with the following alternate domain names (CNAMEs), all have SSL certificates as well-
general.example.com
whatsnew.example.com
help.secondary.com
Since we're retiring example.com we've been trying to redirect general.example.com & whatsnew.example.com to help.secondary.com. For now the CloudFront distributions for #1 and #2 above have been disabled. Following the below guide I was able to redirect the root domain (example.com) to help.secondary.com.
AWS Doc on redirecting domains
Currently the Route 53 root record for the example.com domain points to an S3 bucket named after it per AWS' doc.
Record name
Type
Value
Error
example.com
A
s3-website-us-east-1.amazonaws.com.
none: redirects successfully
However when I try this for general & whatsnew (these have their own S3 buckets as well) the redirection fails with the only error code being ERR_CONNECTION_TIMED_OUT. Below are other changes I've tested in Route 53, through an incognito Chrome browser, and their results.I get the SSL errors are due to the difference in domains but I'm not understanding how the same config works for example.com and not its subdomains. May not matter but the secondary.com domain lives in a different AWS account, which we also own. Are these redirections possible?
Record name
Type
Value
Error
general.example.com
CNAME
example.com
ERR_CONNECTION_TIMED_OUT
general.example.com
CNAME
help.secondary.com
ERR_SSL_PROTOCOL_ERROR
general.example.com
CNAME
randomstring.cloudfront.net (CloudFront domain name for help.secondary.com)
ERR_SSL_PROTOCOL_ERROR

Want to redirect naked domain name to www.example.com using Route53, my buckets are there in s3 with the same name as domain

My website is opening correctly for www.example.com but when i am trying to create the recordset for example.com and it is appending the www.example.com, and its getting incorrect,
how to remove the appending part, or is there any other way to redirect naked domain to www.example.com ?
Reverse is possible by adding www. But i dont want this.
You can see the beside the name the appending string is given in the screenshot.
It looks as though you created a hosted zone with the www included.
Create a new hosted zone for example.com and migrate the contents of www.example.com into it (except NS and SOA records).
Once you have done this you will then need to update your registrar to use the nameservers for the example.com hosted zone.

I deployed a react app to AWS ECS and bought a custom domain, but I can not access it with "www" before the domain name

so I can do "domain.com"
but I cannot do "www.domain.com"
additionally, when I add "https" to the beginning I get a "connection not private" message, however I have a public cert from amazon.
any ideas what's up with either problem?
The www part is a subdomain of domain.com. You will need to handle routing when users visit this subdomain. You can either serve the same files as on the root domain, or you can redirect to domain.com.
To access your site via https you need to configure SSL.
You can use CloudFront and Route53 to solve these issues.
Here is a guide on handling routing for subdomains in Route53.

I cannot send www.example.com to example.com in aws route53

I'm using route53, elb, ec2 in aws.
I have set example.com connected to elb.
It works fine.
Currenlty, I'm trying to connect www.example.com to example.com,
and I'm stuck.
I checked whether I can connect test.example.com to example.com,
and It worked. Either using CNAME or using s3 static website hosting
(redirection) worked.
But for www.example.com, these methods doesn't work,
and I'm not figuring out why.
Thank you for answering my question.
I'm updating the details.
I have set my domain example.com on Route53, and I can access to it. I also wanted it to be accessible with www.example.com, so I added a CNAME record www.example.com pointing to example.com. However, my browser failed to load www.example.com.
I tried another method, S3 static website hosting. I created a bucket named www.example.com, made it redirect to example.com, and got a s3 url. I added a CNAME record www.example.com pointing to the s3 url. Again, my browser failed to load www.example.com.
I changed my approach.
Instead of www, I decided to test test.example.com with the same methods that I tried, and it worked fine. My browser loaded test.example.com successfully.
When I tried to access test.example.com, it fails to load fast when it's not configured. On the other hand, with www.example.com, the browser displays loading message on the status bar for a long time, and shows white blank screen.
I want to make it work with www.example.com
You haven't said exactly what you've done to redirect between mydomain.com and www.mydomain.com so it's difficult to tell you why it isn't working.
I have my personal domain set up in this way, where the bucket mydomain.com is set up in S3 to "Redirect all requests to another host name" and that host name is www.mydomain.com (see the "static website hosting" section in the bucket properties).
I notice that in Route 53 I have A records set up for both mydomain.com and www.mydomain.com and in both cases I have aliases set up aliasing the target s3-website-eu-west-1.amazonaws.com. to a hosted zone ID. I don't remember doing that though!