473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Global.Asa and more

Hi,

I need some help on this topic.

I have a generic website where I would like to point different domain names
as well as virtual directories.
Right now, I create for each domain name a directory, I store a copy of the
generic website
and I set a value to a variable into my global.asa called
Application("IDSITE")= xxx
With this variable, I know which datas I have to use with my Database.

Using this system, that means If I make updates or add new asp pages
I have to copy them into each directory.

So my question is, how to avoid this..
Is there a way within IIS to add a value (which will be the IDSITE) for each
domain name or virtual directories ?
The goal would be to create a directory for each domain names where I will
just put a global.asa and use a generic directory (where the generic
website will be stored)

Or is it possible to use conditions within the global.asa.
Something like this :
Select Case DomainName
Case "firstdomainename.com"
Application("IDSITE")=1
Case "seconddomainename.com"
Application("IDSITE")=2
Case "thirddomainename.com"
Application("IDSITE")=3
End Select
But in this case how to know which domain name and "VIRTUAL DIRECTORY" was
called
For the domain name, I think I can use the Server variable "Server_name" or
"http_host"
but for the virtual directory I don't know how to control it.

Any help ?

Stan
Jul 22 '05 #1
1 1508
io
You don't need to maintain multiple directories. As soon as your domain
names mapped to same physical server, that is, IP address you can handle it
quite easy. This is, in fact, a classical badging scenario. Global.asa is
not the place for what you're trying to achieve. The better candidate would
be default.asp

"Stan Sainte-Rose" <st**@nospamcyber972.com> wrote in message
news:Og**************@TK2MSFTNGP14.phx.gbl...
Hi,

I need some help on this topic.

I have a generic website where I would like to point different domain names as well as virtual directories.
Right now, I create for each domain name a directory, I store a copy of the generic website
and I set a value to a variable into my global.asa called
Application("IDSITE")= xxx
With this variable, I know which datas I have to use with my Database.

Using this system, that means If I make updates or add new asp pages
I have to copy them into each directory.

So my question is, how to avoid this..
Is there a way within IIS to add a value (which will be the IDSITE) for each domain name or virtual directories ?
The goal would be to create a directory for each domain names where I will
just put a global.asa and use a generic directory (where the generic
website will be stored)

Or is it possible to use conditions within the global.asa.
Something like this :
Select Case DomainName
Case "firstdomainename.com"
Application("IDSITE")=1
Case "seconddomainename.com"
Application("IDSITE")=2
Case "thirddomainename.com"
Application("IDSITE")=3
End Select
But in this case how to know which domain name and "VIRTUAL DIRECTORY" was
called
For the domain name, I think I can use the Server variable "Server_name" or "http_host"
but for the virtual directory I don't know how to control it.

Any help ?

Stan

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

88
by: Tim Tyler | last post by:
PHP puts most of its functions into a big flat global namespace. That leads to short function names - but creates a namespace minefield for programmers. Lots of the functions are legacies from...
8
by: lawrence | last post by:
I'm learning Javascript. I downloaded a script for study. Please tell me how the variable "loop" can have scope in the first function when it is altered in the second function? It is not defined...
7
by: Michael | last post by:
Hi newsgroup, as the subject indicates I am looking for an advice using global variables. I am not if this problem is more about style then C. If its wrong in thi group, sorry. So I have a...
1
by: noname | last post by:
i have the following in global.asax: <%@ Application Codebehind="Global.asax.cs" Inherits="Foo.Global" Classname="AppClass" %> but wherever i use AppClass.foo() i get the compiler error: The...
5
by: WJ | last post by:
I am attempting to use the Global.Asax to store my user's configuration. Here is the concept: 1. User logs on into the site using Form Authentication. 2. I capture the user Credential, verify it...
44
by: fabio | last post by:
Why? i' ve heard about this, the usage of global vars instead of locals is discouraged, but why? thx :)
18
by: robert | last post by:
Using global variables in Python often raises chaos. Other languages use a clear prefix for globals. * you forget to declare a global * or you declare a global too much or in conflict * you...
23
by: David Colliver | last post by:
Hi, using c#, 1.1 I know that we are not supposed to use global variables etc. in c# I am having a problem, but not sure how to resolve. I did have another post here, but may have over...
16
by: thefritz_j | last post by:
We just converted our VS2003 1.1 VB web project (which was working fine) to VS2005 2.0 and now I get: Parser Error Message: Could not load type '<Namespace>.'. Source Error: Line 1: <%@...
112
by: istillshine | last post by:
When I control if I print messages, I usually use a global variable "int silent". When I set "-silent" flag in my command line parameters, I set silent = 1 in my main.c. I have many functions...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.