Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: Need to map one sub domain. |
|
Author |
|
sahillihas8487
Joined: 02 Sep 2009 Posts: 8
|
Posted: Sat 15 May '10 0:05 Post subject: Need to map one sub domain. |
|
|
Hi .....
I have one intersting issue here .......
The issue i will explain after taking one example......................
Suppose i have one domain like xyz.com. And also have two sub domain a.xyz.com & b.xyz.com.Now suppose we have 3rd anonymous user sahil.
Now only xyz.com is listed in DNS.But if sahil gives the address a.xyz.com in web browser then will it search the sub domain a.xyz.com or not. if yes then how .....do we need to add someting in apche conf file.
also...........
if there is another sub domain like c.xyz.com...........
if i want to map c.xyz.com to a.xyz.com then how can i do it....means how to add c.xyz.com to a.xyz.com ..........means whats to be added in conf file.
Thanks in advance................. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 15 May '10 1:01 Post subject: |
|
|
1. No, because Sahil's browser will not know where to go. *
2. In the <VirtualHost> container for a.xyz.com
ServerName a.xyz.com
ServerAlias c.xyz.com
* = exception to this rule is a wildcard dns record, e.g. *.xyz.com, then
anything.xyz.com will get to the right place and Apache will sort it out.
I use them, I love them, they do have a upside and downside to them though. |
|
Back to top |
|
sahillihas8487
Joined: 02 Sep 2009 Posts: 8
|
Posted: Sat 15 May '10 21:52 Post subject: |
|
|
thanks glsmith for replying............
....you mean to ay throgh virtual hosing i can do that ....if yes then how..... |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sun 16 May '10 4:50 Post subject: |
|
|
Well if xyz.com and a.xyz.com are two separate hosts with different content, then yes, you will need to use Virtual Hosts.
If they are all the same then you just need to get a & c's DNS records pointed to the server and nothing more as Apache will answer to anything going to your IP regardless out of the box.
However, if the two are seperate, and this is what I think you are asking for, here's an example taken to the Nth degree.
Site 1: http://one.apachehaus.net (xyz.com)
Site 2: http://two.apachehaus.net (a.xyz.com)
Not a lot there but they are two different hosts with slightly different content. Now run the alphabet.
http://a.apachehaus.net http://b.apachehaus.net .... http://z.apachehaus.net
You will notice you will bounce back and forth between site 1 & 2 with an exception when you get to o and p which are the same and then it alternates again through z
when you've gotten tired of running the alphabet see
http://how.apachehaus.net
Disclaimer: if you are seeing this in the coming weeks and months after it was posted, chances of these URLs still being active are slim to none, or at least will not be correct any longer. |
|
Back to top |
|
|
|
|
|
|