Redirect to subdomain on jboss on a virtual ip

hi

i have 2 subdomains on 1 host
subdom1.main.com
subdom2.main.com

each subdomain is mapped to unique virtual IP address.

Apache listens on port 80. Web application for subdom2.main.com runs on jboss
which is bound to ip for subdom2 and listening on
port 18443. without using mod_rewrite, if user sends
request like - subdom2.main.com - it goes to apache
instead of jboss. So, to send it to jboss

i inserted the foll. in httpd.conf -

RewriteEngine on
RewriteCond %{HTTP_HOST} subdom2.main.com
RewriteRule (.*) https://<subdom2 ip>:18443/webapp/$1 [R]
RewriteLog “/usr/local/jboss-4.2.2.GA/rewrite.log”
RewriteLogLevel 10

this works, but client browser shows the subdom2 ip address.
How can it just show subdom2.main.com in the browser address?

i couldnt find any other post addressing similar issue.

Thanks in advance for any help.

Nitin

I’m pretty sure what you want is not possible with mod_rewrite (at least I have no idea how one would go about it), but this article sounds like it has a configuration that does what you want using ProxyPass instead of mod_rewrite Using Apache Virtual Hosts and ProxyPass Together

HTH :slight_smile:

Thanks ScallioXTX!

i would try what you have suggested and update
once i have some results.

thanks again!

Nitin