|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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! |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
The hosts are all on the same machine, same IP.
|
|
#4
|
||||
|
||||
|
Quote:
mod_rewrite can do this for you. Have a read of http://www.engelschall.com/pw/apache/rewriteguide/ for some tips. Quote:
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. |
|
#5
|
|||
|
|||
|
Thanks, I got it working!
|
![]() |
| Viewing: Dev Shed Forums > System Administration > DNS > DNS wildcard trick |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|