logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: ServerAlias of VHost ??
Author
Lutz-R. Frank



Joined: 03 Dec 2005
Posts: 21
Location: Germany

PostPosted: Mon 24 Jul '06 15:38    Post subject: ServerAlias of VHost ?? Reply with quote

I want to adress parts of my Apache-Web directly. What do I need to get something like

http://aaa.mydomain.com to jump to http://mydomain.com/aaa

and

http://bbb.mydomain.com to jum to http://mydomain.com/bbb

Is something like this possible at all?

Many Thanks for any Tips ...
CU

Lutz
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Mon 24 Jul '06 17:09    Post subject: Reply with quote

Sure, mod-rewrite is the way to go.

Steffen
Back to top
Mitron



Joined: 04 Jan 2006
Posts: 63

PostPosted: Tue 25 Jul '06 12:00    Post subject: Reply with quote

Hmm, mod_rewrite will also work. However, I just do something like this in my httpd-vhosts.conf to achieve the results you list above:

Code:
<VirtualHost *:80>
    ServerAdmin webmaster@mydomain.com
    DocumentRoot /www/mydomain.com/htdocs
    ServerName mydomain.com
    ServerAlias www.mydomain.com
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@mydomain.com
    DocumentRoot /www/mydomain.com/htdocs/aaa
    ServerName mydomain.com
    ServerAlias aaa.mydomain.com
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@mydomain.com
    DocumentRoot /www/mydomain.com/htdocs/bbb
    ServerName mydomain.com
    ServerAlias bbb.mydomain.com
</VirtualHost>

This will allow you three domains from the main server, two of which are served from sub-folders under your main site. Of course you could locate the two domains anywhere besides under the main site as well.

Be aware that if you're running dynamic DNS through Zone Edit, you will also have to assign the aaa.mydomain.com and bbb.mydomain.com to your IP Address fields for that zone. Also in your Dynamic Update application, I use Site Developers, you may also have to create an entry for each domain in order to update your IP's.

Hope that helps. Smile
Back to top


Reply to topic   Topic: ServerAlias of VHost ?? View previous topic :: View next topic
Post new topic   Forum Index -> Apache