Solved

Subdomain without chaning dns - is there a way?

Posted on 2006-11-22
12
362 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
two submit buttons one form 15 74
Update field in order 21 122
Select2 jquery help 9 74
Error viewing ASP page 12 148
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

914 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

18 Experts available now in Live!

Get 1:1 Help Now