Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 9th, 2006, 06:45 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default create subdomain

Hi,
How can I create subdomain programatically through asp code?
Ihave seen this on some weblogs.
when the user registers a subdomain is created for him like this
Username.Sitename.com

Thanks in advance for your help

 
Old January 11th, 2006, 01:39 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You are going to have to define "create subdomain" a little further. Where are you hoping to create it?

-Peter
 
Old January 14th, 2006, 07:50 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It is clear.
sth like subDomainName.Mysite.com
I want to have an asp page to dynamically create this subdomain for me.

 
Old January 14th, 2006, 08:18 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I agree with Peter it's no so clear. There is more than 1 way to "create a domain". What exactly do you want to do?

Register the subdomain in a DNS server? Create a separate website in IIS that listens to this hostheader? Add the new subdomain as a hostheader to an existing site? And so on and so on.

BTW, didn't we do this here: http://p2p.wrox.com/topic.asp?TOPIC_ID=38470

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 14th, 2006, 09:53 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I really have no idea.
I have seen a weblog that when you register it creates your username as a subdomainfor ex . myName.weblogfa.com immediately after you register.
How do they do this.
They use asp scripts.
I have even access to my server ontrol panel.
I believe they do this through some asp code
maybe it is a subdomain as a host header.


 
Old January 14th, 2006, 09:58 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

In that case, check out my answer in your other post about this subject.

You need a few things to make this work:

1. A * record for your domain pointing to your server.
You can check this by pinging to DoesNotExist.YourDomain.com. If you get a reply from the IP address that is used by your main www.YourDomain.com account, you have a * record.

2. Permission to programmatically access the IIS metabase.
Using ADSI you can program against IIS and create new sites and add host headers on the fly. I gave you a few links to ADSI documentation that you should read to understand how this works.

Note that on a shared server, you probably don't have permissions to do this. In that case, only your ISP can create new sites and sub domains.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 14th, 2006, 10:48 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks a lot for your quick answers imar

 
Old February 20th, 2006, 05:24 AM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello to everyone,

I m trying to do the same, i.e trying to create a subdomain programatically. Please can any one send me the links to ADSI and examples for setting the subdomains using asp script

 
Old February 20th, 2006, 05:44 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Just follow the link mentioned after "BTW, didn't we do this here"

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to maintain session between Domain &subdomain im.imrankhan PHP How-To 1 September 5th, 2008 12:44 PM
create subdomain keyvanjan Classic ASP Professional 13 April 21st, 2008 12:46 AM
Error giving when i create the Subdomain Surjit Classic ASP Professional 0 April 18th, 2008 06:17 AM
Create generic XSL Template to create table Venkatachalapathy XSLT 5 March 11th, 2008 07:49 AM
how to create editor ibrahim C# 2 December 17th, 2003 11:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.