0

Is there a way that i can redirect wildcard vhost on apache sub-domains to another domain?

i.e,

https://abc.domain1.com --> https://abc.domain2.com
https://xyz.domain1.com --> https://xyz.domain2.com

vhost configuration example below:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName *.domain1.com


        DocumentRoot /var/www/domain1
Redirect permanent /  https://*.domain2.com
......
</VirtualHost>
<VirtualHost 2.2.2.2:443>
        ServerAdmin webmaster@localhost
        ServerName *.domain1.com
DocumentRoot /var/www/domain1
Redirect permanent /  https://*.domain2.com
...........
</VirtualHost>

1 Answer 1

0

The way you try to do that will rather not work - but I think rewrite module and rewriting rules may be interesting for you.

1
  • I saw something like that, but didn't find out how to use it, in my case, i want something generic to detect the subdomain name, and only changes the domain name. Jan 14, 2016 at 10:28

You must log in to answer this question.

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