Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a production site, running off 10 servers. I've been given another virtual server on the same network as these 10 servers, to use for testing purposes. This server doesn't have it's own DNS entry. Therefore I need to do a redirect to the site hosted on this virtual server for a sub-domain of the site running on the 10 other servers.

So Basically I was wondering how I would configure a sub domain of my production server to point at the Virtual server for testing.

I'm guessing I need to modify my site file in


and add another virtual host like the following and modify the redirect match:

<VirtualHost *>
        RedirectMatch 301 (.*) **IP ADDRESS**
        CustomLog /var/log/apache2/ combined

Do I set the redirect match to just the IP on the Virtual server, and then configure another site file in the sites-available directory, which will recption this redirect and point the browser towards the HTML root?

Thanks, I hope I made myself clear.

share|improve this question
Do you want simply to redirect to the test server or do you want the address to stay in the address bar? You could take a look at mod_proxy: – Frands Hansen Feb 17 '11 at 13:02
preferably to have the address stay in the address bar. basically have it act as a sub-domain, and when you go to that URL and visit pages it'll stay with the subdomain in the URl as one browses the site. Will have a look at that link. Thank you – Mark Cameron Feb 17 '11 at 14:24

zeroFIG@ when you do a 301 redirection the address in the address bar will change. If you want to keep the address the same you can look at apache mod_proxy as pointed out by fbh@.

Secondly if its an internal server, with an internal IP your clients will get an error. i.e if redirected to then I will get a error if I am access the site over the internet.

share|improve this answer
I see I see, so if there isn't a public IP for that virtual server, there is no way to access it from outside of the VLAN where the servers lie. If there is, I'd not want to do a 301, otherwise they would have the IP of the server in their address bar. SO what redirect code would I use? – Mark Cameron Feb 17 '11 at 15:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.