I’ve converted my wordpress blog to gatsby which I’m hosting on netlify at ecofem.netlify.app.
I already had a domain (ecofeministmama.com) and I asked the hosting company (lowesthosting) to sort out the forwarding. They did that with the following .htaccess file:
RewriteEngine on RewriteBase / RewriteRule (.*) https://ecofem.netlify.app/$1 [R=301,L]
…This forwarded users ok, but it left ‘ecofem.netlify.app’ in the address bar. Lowesthosting weren’t able to offer a satisfactory solution to this.
So I did some research and have now set things up successfully by setting up the custom domain in netlify, copying across all the DNS records, and pointing the lowesthosting nameservers at the netlify ones.
So this seems to work perfectly now (i.e. type in ecofeministmama.com and you get the gatsby site and see ‘ecofeministmama.com’ in the address bar). BUT in my own browser I still see ecofem.netlify.app - I guess the 301 is cached. Of course, i can clear my browser’s cache, but the point is that any visitors who visited in that period when the 301 was in force (i.e. before I configured the netlify DNS etc.) will see ‘ecofem.netlify.app’ …forever?! (I don’t know much about redirects, but I understand you can put an expiry on 301s - unfortunately the lowesthosting person didn’t!)
This stackoverflow post mentions setting a redirect right back, in the hope (?) that a browser will see the circular redirects and invalidate their own cached redirect. But I’d greatly appreciate the insight of any netlify experts in case there is something else I can do - or indeed if they are able to confirm or deny that this redirect-back idea will work and won’t break anything else!