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

Posted on 2007-08-10
Last Modified: 2013-12-16
I have the domain and i'd like to forward to another directory (

This is my httpd.conf:

DocumentRoot /home/dprundle/public_html/warcraftmmo
BytesLog domlogs/

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

DocumentRoot /home/dprundle/public_html/warcraftmmo/gmail

This is my named:

gmail 14400 IN A 14400 IN A

My problem is that just forwards to instead of

any help is appreciated.

Question by:dprundle
    LVL 7

    Expert Comment

    this has nothing to do with dns.  all you need to do is either create a .htaccess file with a redirect to

    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

    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
    LVL 7

    Expert Comment

    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

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    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…
    Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now