I have two different domain & sub domain.
For example :-
Domain 1 :- example1.com IP :- XXX.XX.XX.201
Domain 2 :- example2.com IP :- XXX.XX.XX.202 (This is a virtual hosting on above IP addr XXX.XX.XX.201)
I am also using sub-domains for the same like,
Domain 1 :- test.example1.com IP :- XXX.XX.XX.201
Domain 2 :- test.example2.com IP :- XXX.XX.XX.202 (This is a virtual hosting on above IP addr XXX.XX.XX.201)
I have to access the application in such way that if i access example.com it will redirect to me app1 and test.example.com will redirect mi to app2.
I have done some configuration related to this in my server.xml of tomcat.
<Host name="localhost" appBase="webapps"></Host>
<Host name="example2.com" appBase="webapps_example2">
<Alias>test.example2.com</Alias>
</Host>
If i hit URL like,
1.
http://example2.com -> I want to show an application app1
2.
http://test.example2.com -> I want to show an application app2
I have deployed app1 in webapps_example2 & when i hit any of the above URL .. both the URL redirecting to the same app1
. Where should i deploy my app2
so it will be accessible by above url no 2.
Note :- test.example.com is a just sample url & sub-domains may be change anytime so i can't put separate virtual host for entry & webapps folder for each sub domain.
app1 is simple html website & app2 is an J2EE application
Can anyone help me for doing this ???
Thanks in advance...