I hardly know any HTML or JavaScript or anything so please be gentle and very explicit in your replies. I would be very, very grateful for some help here.
I am having a similar issue, but following the steps proposed above doesn’t do the trick. Initially, I deployed my website on Netlify with a default domain (.netlify.com) that pointed to my GitHub repo. I have recently registered my domain via Netlify, but from my GoogleAnalytics I still see people going on my .netlify.com (now, .app) page, instead of on the right website (www.lucacarbone.com).
Probably, I am doing something wrong following the instructions above. I have created a new file in my public folder (which is my publish directory) and I’ve tried both with /* /index.html 200 and with /app/* /app/index.html 200! but none redirects to my current page. Do you have any suggestion?
However, you already have that rule in netlify.toml:
[[redirects]]
from = "https://lucacarbone.netlify.app"
to = "https://www.lucacarbone.com"
status = 301
force = true
I would recommend a second rule be added to redirect other pages/assets to the custom domain as well:
[[redirects]]
from = "https://lucacarbone.netlify.app/*"
to = "https://www.lucacarbone.com/:splat"
status = 301
force = true
With both redirect rules, nothing will be served from lucacarbone.netlify.app except 301 redirects to the custom domain. Only the custom domain will be used for the site with both rules in place.
If there are any questions about this, please let us know.