named and httpd.conf forward a subdomain to another directory on the server

Posted on 2007-08-10
Medium Priority
Last Modified: 2013-12-16
I have the domain warcraftmmo.com and i'd like to forward gmail.warcraftmmo.com to another directory (http://www.warcraftmmo.com/gmail/).

This is my httpd.conf:

ServerAdmin webmaster@warcraftmmo.wvutalk.com
DocumentRoot /home/dprundle/public_html/warcraftmmo
BytesLog domlogs/warcraftmmo.wvutalk.com-bytes_log
ServerName warcraftmmo.com
ServerAlias www.warcraftmmo.com

User dprundle
Group dprundle
CustomLog /usr/local/apache/domlogs/warcraftmmo.wvutalk.com combined
ScriptAlias /cgi-bin/ /home/dprundle/public_html/warcraftmmo/cgi-bin/

ServerName gmail.warcraftmmo.com
DocumentRoot /home/dprundle/public_html/warcraftmmo/gmail

This is my named:

mail IN CNAME warcraftmmo.com.
www IN CNAME warcraftmmo.com.
gmail 14400 IN A
www.gmail 14400 IN A

My problem is that gmail.warcraftmmo.com just forwards to www.warcraftmmo.com instead of www.warcraftmmo.com/gmail/

any help is appreciated.

Question by:dprundle
  • 2

Expert Comment

ID: 19671966
this has nothing to do with dns.  all you need to do is either create a .htaccess file with a redirect to newsite.com/whatever.html.

or just put an index file in the root of the old domains site directory and put a meta redirect for it to go to the new site...

this will outline your options in detail.

LVL 19

Accepted Solution

alextoft earned 2000 total points
ID: 19672646
It's more to do with using the same IP for the virtualhost... use the name instead. Here's the example from the Apache config. Make sure you include the NameVirtualHost directive...

 NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain

<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain

Expert Comment

ID: 19672783
ouch, yup i totally missed that.  you need to configure it for named based virutal hosts rather than ip based virtualhosts, or just give the box a new ip and make each of those virtualhosts unique ip's

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month14 days, 8 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question