Apache : Forward request to another server

tuty_richard

New member
Joined
Nov 29, 2008
Messages
2
I have static IP set to my router. I am running two web servers. I have redirected my 80 port from the router to my server 1 its working fine. I need a help in setting up like this

I have domain say mydomain.com when ever I type mydomain.com in my browser it comes to my router then to my server 1 thats fine.

I have sub domain say sub.mydomain.com when ever I type sub.mydomain.com the router redirects to my webserver1. but what I need is my sub.mydomain has to be served by my server 2.

<VirtualHost *:80>
ServerName sub.mydomain
ServerAlias www.sub.mydomain
RewriteEngine On
RewriteRule ^(.*)$ http://192.168.0.101$1 [P]
</VirtualHost>

By adding this setup when ever I type sub.mydomain it redirects to my server 2 that is fine. But when my url changes to like sub.mydomain.com/mail the browser shows like http://192.168.0.101:80/mail. How to over come this problem please help me.

Thanks
Richard
 
This doesnt seem like a question pertaining to directadmin control panel. Maybe you will have more luck in a general apache or linux forum.
 
Why not just set the DNS to send requests for sub.mydomain to the IP adress of the server where the site is hosted?
 
Back
Top