2

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?

1 Answer 1

4

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>
1
  • Perfect man, thanks! RewriteCond %{HTTP_HOST} ^(.*)?xyz\.com$ [nocase] RewriteRule (.*) http://%1abc.com/$1 [R=301,L] You saved my tail ;)
    – bigdawggi
    Jul 16, 2010 at 10:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .