To configure a redirect you should use an URL record as described in our redirect documentation.
However, it's not possible to redirect an HTTPS URL because of the priority between SSL negotiation and HTTP headers. In this case, because you also want https://ourdomain.com
to redirect to https://www.ourdomain.com
, then you need to create an ALIAS for ourdomain.com to your Heroku SSL endpoint and handle the redirect in your app.