Hey all, I'm trying to move to another domain, but have many subdomains under the existing domain. All the subdomains will be the same but just mapped with the new domain.

[subdomain].xyz.com => [subdomain].abc.com

The DNS is set up so all requests are going to the proper box, and I have a vhost set up to respond to them all, I just need to now redirect the domains.

Ideas?

link|improve this question
feedback

1 Answer

up vote 4 down vote accepted

I think you can use something like this:

<VirtualHost *:80>
    ServerName xyz.com
    ServerAlias *.xyz.com
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(.*)xyz.com$
    RewriteRule ^.*$ http://%1abc.com$0
</VirtualHost>
link|improve this answer
Perfect man, thanks! RewriteCond %{HTTP_HOST} ^(.*)?xyz\.com$ [nocase] RewriteRule (.*) http://%1abc.com/$1 [R=301,L] You saved my tail ;) – bigdawggi Jul 16 '10 at 10:04
feedback

Your Answer

 
or
required, but never shown

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