I have a node app hosted on heroku and have two domains set up.
www.mydomain.io and mydomain.io
In namecheap I have pointed my cname record to www.mydomain.io and created an alias which points at mydomain.io. Both work in the browser but is there a way to automatically redirect any requests for www.mydomain.io to mydomain.io?
I have checked with Namecheap support who suggested using a redirect, but that would mean any requests for https://www.mydomain.io would fail.
question from:https://stackoverflow.com/questions/65934920/is-there-a-way-to-automatically-route-www-domain-to-non-www-domain-using-nameche