Skip navigation

NOT domain.com BUT www.domain.com

Help

NOT domain.com BUT www.domain.com

Hi, I have migrated some sites to Aegir and these sites have previously been used with "www" prefix. But now all sites are forwarded from "www.domain.com" alias to "domain.com".

I just noticed that there's "Hosting" -> "Site aliases" page at Aegir and I have now activated "Generate domain.com alias automatically" and deselected "Generate www.domain.com alias automatically".

Problem is that I don't know how to change back to "www.domain.com" and generate "domain.com" alias. I tried migrate path but I just got this: The domain name you have specified is not unique.

Should I create a new platform for it...?

#1

To redirect foo.com to www.foo.com you need to use www.foo.com as a main domain name for the site created in Aegir and enable standard redirect. It will add foo.com as an alias automatically when you have this option enabled in "Hosting" -> "Site aliases".

If your site is already created with foo.com, you can't rename it directly to www.foo.com, however. It is because www.foo.com alias is already "taken" so it is a classic chicken/egg syndrome.

You will need to rename the site to anything.foo.com first and then back to www.foo.com, plus enable redirect.

Now any visit to foo.com will cause 301 redirect to www.foo.com

#2

You could also disable creating aliases automatically, re-verify the site, so it will remove its www alias, rename it (using Migrate task) to www.foo.com, then enable automatically created aliases and re-verify the site again, so foo.com alias will be added for you.

#3

Thanks a lot! I managed to change my domain prefix with these instructions. I was first confused because after the migration my site gave white screen but then I realized that I should empty cache tables manually. Though, I have bigger problem now with my Apache.

Need help?

Discussion

The discussion area lets your team communicate by posting updates and discussing issues. It is a great place for sharing progress, discussing challenges, and exploring ideas.