473,657 Members | 2,456 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extracting the domain name

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?
Jul 19 '05 #1
2 1893
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

"Roger Withnell" <ro***@upperbri dge.co.uk> wrote in message
news:06******** *************** *****@phx.gbl.. .
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?

Jul 19 '05 #2
Ray at <%=sLocation% > wrote on 04 okt 2003 in
microsoft.publi c.inetserver.as p.general:
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.ServerV ariables("HTTP_ HOST")
url = Request.ServerV ariables("URL")
if instr(url,"/mydomain")<>1 then
If instr(host,"myd omain.org") = 1 Then
server.transfer "/mydomainORG" & url
ElseIf instr(host,"myd omain.com") = 1 Then
server.transfer "/mydomainCOM" & url
ElseIf instr(host,"myd omain.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 !!!
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3

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

Similar topics

2
4036
by: Laz | last post by:
Hi, I've not worked with javascript, and after searching could not find example of this type of manipulation. I'm trying to set a variable to the last portion of a domain name. for example, if the URL is http://www.telefonica.es/index.php, I'd like to get the "es" code into a variable. Is there a predefined call for this?
5
1785
by: Michael Powe | last post by:
Hello, I wish to extract some text from certain elements on the page and process them. I've done this in the past by keying on the className but I don't have that option in this case. Below is an example of what I have to work with. I need to extract the SKU, Product, Qty, Price & Extended Price. Here's one try I made:
0
1392
by: dmbkiwi | last post by:
I am trying to extract the value of a cookie from a CookieJar() object using cookielib. I have a CookieJar() object called cj. Printing cj gives: <_LWPCookieJar.LWPCookieJar> But i can't work out how to extract the value. If I use make_cookies(), I get:
14
3742
by: Adnan Siddiqi | last post by:
Hi Suppose I have following URLs comming from an HTML document <a href="http://mydomain1.com">Domain1</a> <a href="http://subdomain.domain.com/myfile.anyext">http://subdomain.domain.com/myfile.anyext</a> <a href="http://subdomain.domain2.com/myfile.anyext">Domain2</a>
1
1931
by: jerryyang_la1 | last post by:
I'm reading in a CSV and displaying using the code below: $users = file("text.txt"); echo "<table border='1' width='75%' align='center'>"; echo "<tr>"; echo "<td width='33%' align='center'><b>Username</b></td>"; echo "<td width='33%' align='center'><b>Domain Name</b></td>"; echo "<td width='34%' align='center'><b>Date & Time</b></td>"; echo "</tr>"; foreach ($users as $user) {
3
1916
by: lazy | last post by:
Hi, Im trying to extract the domain name from an url. lets say I call it full_domain and significant_domain(which is the homepage domain) Eg: url=http://en.wikipedia.org/wiki/IPod , full_domain=en.wikipedia.org ,significant_domain=wikipedia.org Using urlsplit (of urlparse module), I will be able to get the full_domain, but Im wondering how to get significant_domain. I will not be able to use like counting the number of dots. etc
1
1674
by: prashanth23in | last post by:
This is my first page <form name="form1" method="post" action="ins_comp.php" onsubmit="return form_chk();"> this is next page where i'm printing the posted values
6
4444
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has some one experience with other libaries to
4
8667
by: Ant | last post by:
Hi all, My kids have a bunch of games that have to be run from CD (on Windows XP). Now they're not very careful with them, and so I have a plan. I've downloaded a utility (Daemon Tools) which allows me to mount and unmount virtual CD drives onto an ISO image. This works well, but I want to wrap this in a Python GUI which will present them with a list of games in a particular directory. Essentially the steps are this:
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8603
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.