How to Dynamically Create Sub Domains
IntroductionHave you even seen a website that immediatly assigns you a personal subdomain as soon as you sign up? Sometimes it takes the form of: myusername.thewebsite.com or something like that. This article will show to how to produce that effect so you can offer this feature to your users.I used this particular feature to offer new groups on my website their own group subdomain. Groupbox is a website for online groups. So if you went to Groupbox and created a new group, you could also choose a unique subdomain to quickly navigate to your newly created group. It would look something like mynewgroup.groupbox.com.After reading this guide you will be able to:Dynamically create subdomains and use them to send users to specific parts of your website.What you will need:I?ll need to assume you know a bit about programming on the web, the .NET framework, and in meratol review this case some VB.NET.This guide references websites that are hosted on IIS. If you?re using something else then you can probably still just adapt most of the logic to suit your hosting.You will probably need to make a change to your DNS zone file for your domain. We?ll discuss this later.You will need to use ISAPI_Rewrite (a 3rd party product) to implement this solution. The lite version is free and will suit your needs. It is installed on the server and uses regular expressions to manipulate URLs. More about this later.How we are going to do it (Summary)To achieve the effect of dynamically creating subdomains what we need to:- redirect all requests sent to the server with a subdomain to a specific page- somehow let that page know which subdomain was used- then redirect the user to the specific page their looking forTo do this, we?ll need to do 3 steps.


No Comments
No comments yet.
Sorry, the comment form is closed at this time.