amplify-hosting
amplify-hosting copied to clipboard
Redirects from your root domain to www does not work
Before opening, please confirm:
- [X] I have checked the custom domains troubleshooting guide.
- [X] I have read the guide for submitting bug reports.
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
App Id
Let me know if it matters
Region
us-east-1
Step
Domain Redirects
Status
Partial failure
Issue or question
My SEO is getting wrecked because we don't have a functioning domain for https://domain.com.
The https://www version works fine, as well as the http:// and http://www. version, but https:// on its own gets either ERR_CONNECTION_TIMED_OUT or ERR_CONNECTION_REFUSED depending on what configuration of redirect rules I have.
Right now we have the following configuration. I've tried multiple other approaches like removing the root domain from domain management and trying to rely just on redirects, I've also tried using alternative redirect types like 200 (rewrite) and 301 (permanent).
Nothing's working.
Error message
ERR_CONNECTION_TIMED_OUT / ERR_CONNECTION_REFUSED
Additional information

Hi :wave:, thanks for opening! While we look into this...
If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions.
Lastly, please make sure you've specified the App ID and Region in the issue!
+1 I've got a custom domain and have already migrated DNS to Route53, had the redirect rules set in AWS Amplify
The problem I face however is DNS_PROBE_FINISHED_NXDOMAIN not timeout
dig +trace shows ...... foobar.app. 10800 IN NS ns-670.awsdns-19.net. foobar.app. 10800 IN NS ns-1927.awsdns-48.co.uk. foobar.app. 10800 IN NS ns-1238.awsdns-26.org. foobar.app. 10800 IN NS ns-64.awsdns-08.com.
foobar.app. 900 IN SOA ns-1238.awsdns-26.org. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400
any pointers will be appreciated! Thank you! :)
Never mind found a way around and got it working 🤣
- In Route53, manually create an A record, for the root domain, tick Alias, Route traffic to "Alias to CloudFront distribution"
- When clicking the drop down, it didn't show any options so I just manually entered the xxxxxxxxx.cloudfront.net from AWS Amplify Console, Domain management, Actions, View DNS record

Never mind found a way around and got it working 🤣
- In Route53, manually create an A record, for the root domain, tick Alias, Route traffic to "Alias to CloudFront distribution"
- When clicking the drop down, it didn't show any options so I just manually entered the xxxxxxxxx.cloudfront.net from AWS Amplify Console, Domain management, Actions, View DNS record
I have the domain and DNS set up in GoDaddy - I'm not sure I have access to those features. Have you got any ideas?
Never mind found a way around and got it working 🤣
- In Route53, manually create an A record, for the root domain, tick Alias, Route traffic to "Alias to CloudFront distribution"
- When clicking the drop down, it didn't show any options so I just manually entered the xxxxxxxxx.cloudfront.net from AWS Amplify Console, Domain management, Actions, View DNS record
I have the domain and DNS set up in GoDaddy - I'm not sure I have access to those features. Have you got any ideas?
I had a domain on GoDaddy too and unfortunately gave up trying to get the DNS working there, so instead migrated the DNS to Route53
In your case, the question is how does your GoDadddy record know what's the IP of your AWS cloudfront is if it's not static, assuming that you don't currently have your IP dynamically mapped? As far as I know GoDaddy doesn't currently support ANAME record
If you're going to migrate your DNS, just a heads up that your website could be offline for a while, so remember to lower the TTL
Hi @jacobsapps 👋🏽 apologies for the delay. It's suggested in the documentation that you migrate your DNS to Route53 in order to configure your root domain since GoDaddy doesn't support ANAME/ALIAS records. The workaround would be to setup a domain forward in GoDaddy. Please see step 6 of Add a custom domain managed by GoDaddy.
Hi @jacobsapps 👋🏽 apologies for the delay. It's suggested in the documentation that you migrate your DNS to Route53 in order to configure your root domain since GoDaddy doesn't support ANAME/ALIAS records. The workaround would be to setup a domain forward in GoDaddy. Please see step 6 of Add a custom domain managed by GoDaddy.
Even after setting the domain forward in GoDaddy, still facing the same issue. Any workaround would be much appreciated
I am facing the same issue with my DNS. I have set up the forwarding as follows (image).

Still facing this issue. I have tried all possible options to resolve this including adding a permanent redirect, rewrite etc. Still no luck with getting non-www working on the root domain.
Facing the same issues aswell, domain.com is not being redirected to www.domain.com
Same as everyone else.
Same here
Same problem. Please, send any instructions
I fixed it! My problem was I was using AWS Amplify and didn't add the non-www url to the custom domain list in the amplify console under "Domain Management" like so:

Then it will have problems adding an extra / at the end of the non-www url, which will break paths to any external images/scripts, so to fix that, you add this under "Rewrites and Redirects"

I was facing same issue but found a cure with the help of @lijameshao who has already replied above.Just add @.example.com and choose alias and problem will be solved
This is from the godaddy forum: @KinaHus That's correct, the forwarding service is not currently compatible with HTTPS. As the forwarding service uses a server to do the redirect it would need to be covered by an SSL certificate for your domain name, which isn't possible at this time.
Does anyone know where the idea to use godaddy even came from?
I've noticed this issue recently when the UI and location of functions has changed on the recent AWS Amplify update. Didn't have this issue before when im setting up my domain in amplify, then recently i got this issue where root domain didnt get automatically redirected to www.
My solution is like this which might help someone so im posting it here.
The 1st record on this image is URL1 which is working fine, URL2(last record) on the other hand is having the issue. after moving URL2 above the 2 records with Target Address: /index.html then save it will now automatically redirect root domain to www.
Hope this helps someone.
@michaeldino27 This worked for me! thanks!
@michaeldino27 This worked for me! thanks!
Happy to help!
In my case, I had an AAAA record in Route53 that I had to remove.
@michaeldino27 Thanks very much, this works!
@michaeldino27 I tried this and couldn't get it to work. Clearly it's working for others so I must have something wrong.
May I ask what your "Custom Domains" tab looks like? And what your relevant entries in Route 53 look like?
I keep getting DNS errors where it can't resolve the host for the root name.
For Amplify devs, maybe you guys could write some sort of trouble shooting tool for this? Right now we edit this page, hit Save and it says "Updating app: success" then proceeds to not work.
@jpangburn
Have a look here.
Can you also show your Rewrites & Redirects so i can have a look as well?
@michaeldino27 Hmm, that's different! I don't have that first one. I wonder if that's the problem. As it stands, I have the following settings:
Custom domains:
Rewrites and redirects:
Route 53:
I made the change like you showed on your custom domain so it looks like:
In route 53, that added a record:
After this was complete, I can now go to the root URL and under the hood it works like going to www.rooturl.com as there's a 302 redirect, so all the referrers in the HTTP headers show www. The funny thing was, I tried adding that DNS record manually yesterday because I thought it just needed an A record aliased to cloudfront, but it didn't work despite looking exactly like what Amplify generated. I think you really need that redirect in Amplify rather than manually putting the A record alias in Route 53, maybe it tells Cloudfront something else we don't see here.
Thank you so much for your help! Hope my notes here help someone else who screwed their configuration up similar to me haha
@jpangburn yeah i have also tried playing around Route 53 prior discovering the solution. Glad the solution worked on you!
Just hoping that amplify team would be able to fix this soon, it used to be automatic but now have to do extra step to make it work. XD
I've tried it again on a new branch and it did it automatically already! thanks amplify team!