DNS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationDNS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old June 20th, 2003, 12:58 PM
scream scream is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 441 scream User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 59 m 38 sec
Reputation Power: 9
Send a message via ICQ to scream
DNS wildcard trick

Hi, I don't know a whole lot about DNS, but I was hoping someone could instruct me how to do this, assuming it's possible. I currently have a DNS wildcard setup, but I would like to modify it a little bit.

If someone visits http://www.domain.com or http://domain.com I would like the default page served to be index.htm

If they visit http://anythingelse.domain.com I would like the default page served to be home.shtml.

Other than the default page for the root web directory, I would like all other files to be served up exactly the same. So http://www.domain.com/directory/ would serve the index file as the default, and http://anythingelse.domain.com/directory/ would also serve the index file as the default. One should be able to view the same picture.jpg by going to http://www.domain.com/picture.jpg or http://anythingelse.domain.com/picture.jpg.

So I guess what I want is a DNS wildcard with that one exception.

Any help for me? THANKS!

Reply With Quote
  #2  
Old June 20th, 2003, 02:54 PM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,193 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 14 h 27 m 56 sec
Reputation Power: 77
The following assumes the different hosts you speak of are located on the same machine, same IP. If that is not the case, tell me:

This doesn't have to do with DNS. What you want is to setup virtual hosts in the apache config. Setup a specific virtual host for index.htm. then setup a default virtual host for anything else to be home.htm.

Reply With Quote
  #3  
Old June 20th, 2003, 05:15 PM
scream scream is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 441 scream User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 59 m 38 sec
Reputation Power: 9
Send a message via ICQ to scream
The hosts are all on the same machine, same IP.

Reply With Quote
  #4  
Old June 20th, 2003, 07:20 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
Quote:
If someone visits http://www.domain.com or http://domain.com I would like the default page served to be index.htm

If they visit http://anythingelse.domain.com I would like the default page served to be home.shtml.

mod_rewrite can do this for you. Have a read of http://www.engelschall.com/pw/apache/rewriteguide/ for some tips.

Quote:
One should be able to view the same picture.jpg by going to http://www.domain.com/picture.jpg or http://anythingelse.domain.com/picture.jpg.

In addition to setting up Apache with virtual hosts, you will need to create wildcard DNS records. I assume you already have this set up - in this case, this thread really belongs in the Apache forum as it is no longer specific to DNS.

With regards to your Apache config, any subdomains that aren't explicitly assigned to a VirtualHost will be served by the first VirtualHost container in httpd.conf - so just make example.com the first VirtualHost, create the wildcard DNS records, and *.example.com will be served by that first VirtualHost.
__________________
Alex
(http://www.alex-greg.com)

Last edited by alexgreg : June 20th, 2003 at 07:28 PM.

Reply With Quote
  #5  
Old June 20th, 2003, 07:48 PM
scream scream is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 441 scream User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 59 m 38 sec
Reputation Power: 9
Send a message via ICQ to scream
Thanks, I got it working!

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationDNS > DNS wildcard trick


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway