Dynamic subdomains to different vhosts

Posted on 2004-04-05
Last Modified: 2010-03-04
With our current hanrdware setup, all the traffic goes through 1 IP address. We would like and to goto the standard directory (ie, /home/domain). All the dynamic subdomains (ie:, should all point to /home/dynamicdomain/. How can I accomplish this?
Question by:dcman99
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

rrusch earned 250 total points
ID: 10761538
For Apache you just need a default virtualhost section. Normally the first in httpd.conf.
Additionally dns has to resolve * to your ip.

--- Example httpd.conf ---
NameVirtualHost *
<VirtualHost *>
        DocumentRoot /home/dynamicdomain

<VirtualHost *>
        DocumentRoot /home/domain
LVL 10

Assisted Solution

Mercantilum earned 250 total points
ID: 10857009
To my mind something is missing in the answer above,
<VirtualHost *>
        DocumentRoot /home/dynamicdomain

This way the 3 subdomains, and point to /home/dynamicdomain
LVL 10

Expert Comment

ID: 10857014
And remove
<VirtualHost *>
        DocumentRoot /home/dynamicdomain
LVL 15

Expert Comment

ID: 11760893
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

    SPLIT: rrusch, Mercantilum

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use of SSL Certificates - http vs https 3 90
Problem with .htaccess file 4 73
PHP in Apache server 20 105
PHP Apache application gives "Forbidden" message 5 77
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
In an interesting question ( here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 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