Forum Moderators: phranque
I have a virtual host file with the following entries...
<VirtualHost *:80 *:81 *:82>
ServerName www.test.com
ServerAlias test.com
ServerAdmin test@test.com
DocumentRoot /data02/oracle/oracleas_web/ohs/htdocs
Redirect 301 /digital http://200.**.132.20/
So we bought http://digital.test.com and we redirected to the ip address specified.
Now we want http://www.digital.test.com to go to the same ip address - can someone please tell me how to do that?
Thanks in advance for all your help.
[edited by: jdMorgan at 12:39 am (utc) on Dec. 8, 2008]
[edit reason] Obscured IP address, de-linked URLs. [/edit]
This is not usually a problem solved in the server itself. Rather, you should simply modify your DNS zone file to point the subdomain digital.test.com and the sub-sub-domain www.digital.test.com to your "digital server's" IP address.
Jim
[edited by: jdMorgan at 12:41 am (utc) on Dec. 8, 2008]
We have one httpd.conf file and a vhost file for each of the other domains. So in this case we have a vhost file called www.test.com.vconf and within that we have the following:
<VirtualHost *:80 *:81 *:82>
ServerName www.test.com
ServerAlias test.com
ServerAdmin test@test.com
DocumentRoot /data02/oracle/oracleas_web/ohs/htdocs
Redirect 301 /digital [200.**.132.20...]
</VirtualHost>
So I am thinking maybe i should create another virtualhost entry for www.digital.test.com?
Am i on the wrong track?
Thanks
I assume that your next step is to get rid of the redirect to the IP address in the www.test.com vHost, and replace it with a redirect or a proxy through-put to the new digital.test.com hostname?
Jim
An alternative would be to add a ServerAlias for www.digital.test.com in the www.test.com vHost container on the test.com server, and then conditionally redirect to digital.test.com if the requested hostname is www.digital.test.com. This can be done with mod_rewrite and a RewriteCond examining the %{HTTP_HOST} variable.
Jim
[edited by: jdMorgan at 3:38 pm (utc) on Dec. 8, 2008]