I am currently trying to get people to go to http://a.abc.com (I send them to the https site after getting some X-HTTP-Headers and saving that in a session) I always want them to go to the a.abc.com site and if the http_host isn't a.abc.com I want them to redirect them there :)
I hope you guys can help?
<VirtualHost *:80>
ServerName a.abc.com
ServerAlias b.abc.com bcd.com efg.com
DocumentRoot /var/www/wclp/public
SetEnv APPLICATION_ENV production
RewriteEngine On
RewriteCond %{HTTP_HOST} !a.abc.com$
RewriteRule ^(.*)$ http://a.abc.com/$1 [R=301, L]
</VirtualHost>
<VirtualHost *:443>
ServerName a.abc.com
ServerAlias b.abc.com bcd.com efg.com
DocumentRoot /var/www/wclp/public
SetEnv APPLICATION_ENV production
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/crt.pem
SSLCertificateKeyFile /etc/apache2/ssl/key.pem
RewriteEngine On
RewriteCond %{HTTP_HOST} !a.abc.com$
RewriteRule ^(.*)$ http://a.abc.com/$1 [R=301, L]
</VirtualHost>