Ubuntu: Apache subdomains wildcard redirection



Question:

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>  


Solution:1

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »