Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have several domains which I'd like to point to another (I'll call it A couple of things aren't entirely clear to me.

First, the DNS. I'm using Kloxo/HyperVM. Do I need to create separate DNS entries for each domain? Or do I just create separate CNAME or other records under I thought it was the latter but when I click on "Add CNAME" I'm prompted to fill in the subdomain portion of

The nameservers have already been set to point to my VPS.

For the redirect, would the following be appropriate within the vhost conf for


RewriteCond %{HTTP_HOST} ^ [NC]
RewriteCond %{HTTP_HOST} * [NC,OR]
RewriteCond %{HTTP_HOST} * [NC,OR]
RewriteCond %{HTTP_HOST} * [NC,OR]
RewriteCond %{HTTP_HOST} * [NC,OR]
RewriteCond %{HTTP_HOST} * [NC]
RewriteRule ^(.*)$$1 [R=301,NC]

(The first condition is just to force the "www" part)

share|improve this question

2 Answers 2

If you are redirecting a few domain to one, why not do this in your registrars account and forward the domains to your one primary domain? Doing it in .htaccess or even in DNS is a bit of a waste of resources when you can configure it in the registrar account to forward.

You can also set your www in the DNS management with @ instead of using a 301

share|improve this answer

I'd use DNS A record and point them to same IP and then using VirtualHost in Apache set them up to be catchall, this way you can have all domains going into one and then if you need to use mod_rewrite you can manipulate with that in whatever way you wish

share|improve this answer
Thanks, Alexus. I did that, and also included the rewrite rules. All is working correctly. However, when creating the DNS zone files for the other domains, I get a bunch of records that I'm not sure are necessary. These are CNAMEs lists, webmail, and ftp; an MX; and a mail A record. SHould I delete those and just keep the www CNAME and the ns* A records? –  user7519 May 15 '11 at 21:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.