Fiddled around with this for way too long, because with the instructions you get from Namecheap, you will end up in an infinite redirect loop using mydomain.com instead of www.mydomain.com.
First, to get to the correct page, go to My Account -> Manage Domains -> Modify Domain and choose “All Host Records”.
Then, instead of how Namecheap tells you to do it, where you have 2 entries like this:
- @, http://mydomain.com, URL Redirect
- www, myapp.herokuapp.com, CNAME (Alias)
You instead have these 3 entries:
- @, http://www.mydomain.com, URL Redirect
- www, myapp.herokuapp.com, CNAME (Alias)
- www, http://mydomain.com, URL Redirect
See the image below.