Forum Moderators: phranque
If( domain == 'www.domain1.com'){
writeCookie(domain1.com);
}
If( domain == 'www.domain2.com'){
writeCookie(domain2.com);
} RewriteEngine On
RewriteCond %{HTTP_X_FORWARDED_HOST} ^(www\.)?domain1\.com/ [NC]
RewriteRule .* - [CO=BALANCEID:balancer.lb2:.domain1.com] [L]
RewriteCond %{HTTP_X_FORWARDED_HOST} ^(www\.)?domain2\.com/ [NC]
RewriteRule .* - [CO=BALANCEID:balancer.lb2:.domain2.com] [L]
RewriteCond %{HTTP_X_FORWARDED_HOST} ^(www\.)?domain3\.com/ [NC]
RewriteRule .* - [CO=BALANCEID:balancer.lb2:.domain3.com] [L] HTTP_HOST or HTTP_X_FORWARDED_HOST variable does not contain a trailing slash. example.com/%{HTTP_X_FORWARDED_HOST}. Watch what happens when you request something from the server. You should be able to see exactly what is in that variable, as it will be shown in the path part of the URL displayed in the browser URL bar.