This sample script shows how to direct visitors to a specified folder or file using ASP based on the domain name the visitor entered in their web browser. The script will read the domain requested by the site visitor and then direct that visitor to a specific folder or file. This script is best used as a site's index page (index.asp).
Dim contentsWidth, newsWidth
host = lcase (request.servervariables("SERVER_NAME"))
serverDir = ""
SELECT CASE host
'this example directs the domains www.apple.com
and apple.com to a folder called /apple
'this example directs the domains www.orange.com
and orange.com to a file called orange.htm
'this example directs all other domains and IP addresses to a folder called /main