Redirecting domain with and without www

Hi,

I’m trying to redirect a dreamhost-managed domain (emandrick.com) to a website I’m building on heroku (XYZ.herokuapp.com).

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

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

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

Any advice appreciated!

Thanks,

Rick

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 7is7.net with or without www redirects to www.7is7.com).

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.

Rick

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 emandrick.com should be a redirect to http://www.emandrick.com. 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: http://bit.ly/SlXpjh 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?