Extracting the domain name

R

Roger Withnell

I'm using one set of database tables to serve many
different domains, using the domain name to identify the
records related to a particular domain.

How do I use ASP to extract the domain name for the page
I'm in so that I can search the database for the
appropriate records?
 
R

Ray at

What do you mean? You have one site in IIS that is serving multiple WWW
domains, or are you talking about NT domains? Can you re-explain this
please?

Ray at home
 
E

Evertjan.

What do you mean? You have one site in IIS that is serving multiple
WWW domains, or are you talking about NT domains? Can you re-explain
this please?

Why not?

You can register many domains and ns-point them to the same IP, having
ASP server.transfer them to a different set of pages.

"<!--#include virtual" this in the top of all your pages

===================

<%
host = Request.ServerVariables("HTTP_HOST")
url = Request.ServerVariables("URL")
if instr(url,"/mydomain")<>1 then
If instr(host,"mydomain.org") = 1 Then
server.transfer "/mydomainORG" & url
ElseIf instr(host,"mydomain.com") = 1 Then
server.transfer "/mydomainCOM" & url
ElseIf instr(host,"mydomain.nl") = 1 Then
server.transfer "/mydomainNL" & url
ElseIf instr(host,"123.123.123.123") = 1 Then
server.transfer "/mydomainIP" & url
End If
server.transfer "/404.asp"
end if
%>

===================

not tested !!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top