Solved

Subdomain without chaning dns - is there a way?

Posted on 2006-11-22
12
361 Views
Last Modified: 2012-05-05
I have a site - let's call it - www.mystupidsite.com

It is a Microsoft server platform (2003 to be exact) with IIS.

I do not manage my dns.

I would like to find a way to set up a virtual directory for a subdomain - let's call it: noonewillvisit.mystupidsite.com

I want to eventually automate this process, so that I can create a script that will take the contents of a form, add an entry, and create subdomains on the fly:

site1.mystupidsite.com
site2.mystupidsite.com

etc.

In Apache, this is quite easy - I can add a permanant redirect ion the .htaccess folder and redirect to the actual directory I want to view.

Is there ANY way to do this in Windows without having to add a record for the subdomain and wait for dns to propagate or am I fooling myself with this notion?

0
Comment
Question by:foreverdita
  • 3
  • 3
  • 2
  • +2
12 Comments
 
LVL 8

Expert Comment

by:esw074
ID: 17997322
Under most circumstances, the DNS record for the domain would include an entry for *.mystupidsite.com, in which case you'd only need to set the subdomain in IIS (probably using host headers).  If your DNS record doesn't already include the wildcard, you can have it added.  The process of setting up the sites can be automated, too.  

http://technet2.microsoft.com/WindowsServer/en/library/ba0e7001-3c41-40b9-b320-b6b6481c97251033.mspx?mfr=true

0
 

Author Comment

by:foreverdita
ID: 17997440
Right - I am good to go on the automating part once I find the manual process that works.  I am looking for a manual process that works - then I can add the automated stuff after.

So in other words, once I have the *.mystupidsite.com working, what can I do in IIS that mimicks the redirect in apache for sub.mystupidsite.com

I guess I am looking for the actual host header file (somewhere on the server) to make the changes and then eventually automate the writing script.
Does this make sense?
0
 
LVL 58

Expert Comment

by:amit_g
ID: 17997555
In IIS it would be a new site, not a virtual directory.

http://www.startvbdotnet.com/aspsite/extras/deploy2.aspx

In the IP address and post settings stage, you need to put the same IP and same port and add the new host header (noonewillvisit.mystupidsite.com) and follow it all the way.
0
 
LVL 8

Expert Comment

by:esw074
ID: 17997567
> So in other words, once I have the *.mystupidsite.com working, what can I do in IIS that mimicks the redirect in apache for sub.mystupidsite.com

Assuming you want to create these as separate sites, the simplest manual process would be to go into IIS and create a new site.  On the "Web Site" tab under site properties, there's a Web Site Identification section with the IP address of the site.  Next to that is a button that says "Advanced...".  Click on that, and you'll have a section called "Multiple Identities for this Web Site".  Here's where you would add "site1.mystupidsite.com" (under Host Header Value).  
0
 
LVL 22

Expert Comment

by:WMIF
ID: 17999051
if you can get any components installed, then you can use something like this to rewrite the host header.  this would all be contained into one site in iis, but many directories inside that site.

http://www.isapirewrite.com/docs/#RewriteHeader
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 2

Expert Comment

by:poopall
ID: 18004971
Set up IIS, and set up the sub domain at your DNS hosting provider.

The do a simple response.redirect on the default page of the new sub domain start page with a variable passed as to which domain the redirect it came from .

You can then run the appropriate script based on the variable passed.


0
 
LVL 58

Accepted Solution

by:
amit_g earned 500 total points
ID: 18209207
Since the asker did not respond, we would not know if it worked for him/her or not but the only way to do this in IIS is to use host headers - the way I suggested.
0
 
LVL 22

Expert Comment

by:WMIF
ID: 18211635
@amit_g - if you read through the documentation that i linked to, you can see that iis is perfectly capable of handling this setup through the isapi rewrite component.  the website properties have an option to respond to specific host headers as you have indicated, but it can also respond to any host header that is sent to the ip address (which is actually the default configuration).  


i believe that i have answered the askers question exactly.  
-my suggestion satisfies the askers first requirement which is no changes made in the dns (assuming that the dns was configured properly to forward any host to the parent domain).  
-it also satisfies the second requirement of making this an automated process.  the rewrite filter does not need to be changed once initially setup.  the server would take the input from the form and create a folder inside the main website directory.  the rewrite filter would pull the value out of the sub-domain entered, and direct the request to the folder with that same name.
>>In Apache, this is quite easy - I can add a permanant redirect ion the .htaccess folder and redirect to the actual directory I want to view.
-my suggestion also basically replicates this same process.  the apache server is doing the same process as the isapi rewrite component.  iis does not have the built in functionality of rewriting like the apache server does, so you have to help it out by installing a component like the one i have suggested.
0
 
LVL 58

Expert Comment

by:amit_g
ID: 18211857
You are right. If component can be installed, isapi rewrite is the way to go. The only reason I stayed out of it was an assumption that if the asker can't manage their own DNS which is far cheaper and easier to do, the asker probably doesn't own the server also. Since the asker did not respond, we won't know. I am fine with your answer being selected. In my opinion this question has PAQ value so should not be deleted.
0
 
LVL 22

Expert Comment

by:WMIF
ID: 18424448
nice...
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now