Redirecting domain with and without www


I’m trying to redirect a dreamhost-managed domain ( to a website I’m building on heroku (

I’m struggling to redirect HTTP requests with AND without a leading ‘www’. Note I want to retain the ‘’ dreamhost domain after redirection, i.e. I want: to redirect to heroku backend
AND to redirect to heroku backend (ideally remapping it to so all the URLs are the same).

Under my Domain management panel, I can setup a CNAME DNS Record for and this redirects nicely. However, it won’t let me set up a redirect for on its own, telling me that “CNAME records may only be used on sub-domains.”.

How do I redirect ‘’ as well? Is there another method I should be using?

Any advice appreciated!



Why don’t you just use the “Redirect” option in the Dreamhost panel? That deals with exactly this, I have several sites redirecting using this feature and they work both with and without www (for instance with or without www redirects to

Hi Otto,

Thanks for the reply. I looked into redirect … however it assumes you want the domain name from the non-Dreamhost destination site: “Redirect this domain to another site, changing the browser’s address in the process.”

What I need is different, I want to retain the source domain name that I have registered on Dreamhost.


I am afraid I don’t understand what you want.

Also redirect can go to any domain, dreamhost hosted or not.

Are you wanting to cloak the off-site domain under your domain name?

Not a fantastic idea - but you can do it from Panel > Domains > Manage Domains.

Hi Rick,

I had someone look into your redirect issue. Turns out you needed to set your domain as a redirect, but to the domain itself, just with http://www. included. so should be a redirect to My Tech Support lead went ahead and set that up for you, and its working already! :slight_smile:

If you have any further questions/concerns regarding this, please feel free to let us know! Or email us: We’ll be happy to help. :slight_smile:

This is exactly what I need help with. Would you or another administrator be able to help me too? I would like [mydomain].com to redirect to www.[mydomain].com. If an admin could PM me, I will reply with my domain.

If you go into the “Edit Domain” section of your panel, there’s a section in there labelled “Do you want the www in your URL?”. Set it appropriately. :slight_smile:

What you don’t need is the “Redirect” section of that page. That’s for setting the whole domain up as a redirect to another domain. If you’ve used that previously, you’ll need to set your domain back up as fully hosted.

Hi Andrew! Thanks for getting back to me. I am not fully hosting using Dreamhost, so what steps should I take then?