RewriteRule multi subdomains doesn't work

#1
Hello,
I've setup up 3 external apps for 3 subdomains and i've used the following rewrite rule: (on example.com)

RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ http://subdomain1_ext_proxy/$1 [P,E=Proxy-Host:subdomain1.mydomain.com]
RewriteRule ^(.*)$ http://subdomain2_ext_proxy/$1 [P,E=Proxy-Host:subdomain2.mydomain.com]
RewriteRule ^(.*)$ http://subdomain3_ext_proxy/$1 [P,E=Proxy-Host:subdomain3.mydomain.com]

The problem is the the 3 subdomains redirect the the subdomain1_ext_proxy.

Any ideas ?

Thank you
 
#3
Awesome it worked! Thank you very much

Here's the script if anybody else needs it:
RewriteCond %{HTTP_HOST} ^subdomain1.mydomain.com
RewriteRule ^(.*)$ http://subdomain1_ext_proxy/$1 [P,E=Proxy-Host:subdomain1.mydomain.com]
RewriteCond %{HTTP_HOST} ^subdomain2.mydomain.com
RewriteRule ^(.*)$ http://subdomain2_ext_proxy/$1 [P,E=Proxy-Host:subdomain2.mydomain.com]
RewriteCond %{HTTP_HOST} ^subdomain3.mydomain.com
RewriteRule ^(.*)$ http://subdomain3_ext_proxy/$1 [P,E=Proxy-Host:subdomain3.mydomain.com]
 
Top