473,757 Members | 3,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tricky SERVER_NAME and HTTP_HOST return values?

These two server variables should ALWAYS return the domain name of the host:

- Request.ServerV ariables("SERVE R_NAME")
- Request.ServerV ariables("HTTP_ HOST")

Under what circumstances can those server variables return the server names of domains
that are completely unrelated to the hosting website???

I know, it's not supposed to work that way, but it is. I'm seeing almost 30,000
accesses/day on an empty website, no less!

For each entry, as a debugging mechanism I decided to log all the
Request.ServerV ariables entries, and that's when I noticed the outrageous behavior of
the above two server variables.

How is this technically, possible???

(I should note that Request.ServerV ariables("HTTP_ REFERER") always returns the proper IP
address for the website. Also, I believe I know WHAT is causing this traffic, but to
prevent defensive answers on this group I don't want to mention that yet.)

THANKS!!!

Bill.

May 2 '07 #1
1 5468

"Bill" <Bi********@not hing.nowrote in message
news:eN******** ******@TK2MSFTN GP02.phx.gbl...
These two server variables should ALWAYS return the domain name of the
host:
>
- Request.ServerV ariables("SERVE R_NAME")
- Request.ServerV ariables("HTTP_ HOST")

Under what circumstances can those server variables return the server
names of domains
that are completely unrelated to the hosting website???

I know, it's not supposed to work that way, but it is. I'm seeing almost
30,000
accesses/day on an empty website, no less!

For each entry, as a debugging mechanism I decided to log all the
Request.ServerV ariables entries, and that's when I noticed the outrageous
behavior of
the above two server variables.

How is this technically, possible???

(I should note that Request.ServerV ariables("HTTP_ REFERER") always returns
the proper IP
address for the website. Also, I believe I know WHAT is causing this
traffic, but to
prevent defensive answers on this group I don't want to mention that yet.)

THANKS!!!

Bill.
In the case of server variables with the HTTP_ prefix these always contain
whatever text is in the Request header with a name matching the rest of the
variable name. All HTTP requests must contain a host: header, however, I'm
not sure what IIS would do it it were left blank.

HTTP_REFERER would therefore return the content of the referer header.
Typically a browser will supply this.

If the client agent added a request header PinkElephants it's value can be
retreived using HTTP_PINKELEPHA NTS.

As to the SERVER_NAME I've never found it to return anything other that
whatever HTTP_HOST does regardless of what the documentation says it does.

IOW, the 'outrageous behavior' is likely caused by one of more clients
mis-behaving and is not the fault of server.

May 3 '07 #2

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

Similar topics

2
4890
by: Leif Wessman | last post by:
I need help creating a regular expression to find the subdomain in the $HTTP_HOST variable. The domain is always in this form: www.domain.com or uk.domain.com or domain.com
3
3237
by: junk | last post by:
Hi can anyone tell me why this doesn't work: <link rel="stylsheet" href="http://<?php echo $_SERVER; ?>/includes/test3.css" type="text/css" /> there is no wrap in the actual file. when I view the source the code is printing the correct information. I think I picked a good one for my first attempt at php. I am trying to
2
5641
by: ssk | last post by:
Hello! I made a web site using PHP Open sources for message board. Everything's fine except one computer can't open a message writing page. The code that gives an error is the following. if(!eregi($HTTP_HOST,$HTTP_REFERER)) Error("Write in the normal way");
0
2609
by: Patrick | last post by:
Greetings, I'm running into an intermittant issue on a web site running dotNet 1.1 sp1. The global.asax the client is using is set up so that it can be used in production, developement, and testing without modfication using Request.ServerVariables("SERVER_NAME") and a select case statement to get the correct sql connection information. The problem in production is that the return from
2
12525
by: E L | last post by:
We have the Request.ServerVariables("SERVER_NAME") used in a classic ASP page using IIS 6. It used to return our website name: www.xxx.name.this when using IIS 5, now it is returning the IP address when we type the full www. url. How can I fix this behavior? *** Sent via Developersdex http://www.developersdex.com ***
1
1345
by: laredotornado | last post by:
Hi, If I have multiple domains (mydomain1.com, mydomain2.com, mydomain3.com) pointing at the same IP, will the call echo $_SERVER{'SERVER_NAME']; return the domain name people type into the URL? If not, what is a PHP call I can make to determine the domain someone typed in?
7
3036
by: Hermann | last post by:
I run a server with apache 1.3 and php 5. Yesterday I notice that sometimes the HTTP_HOST server variable has a comma separated list in it. Let's say my domain name is: www.mydomain.com Usually the HTTP_HOST value is of course "www.mydomain.com". But sometimes it is: "www.mydomain.com, www.mydomain.com". Is that supposed to be a correct behabior??
7
24598
by: JC | last post by:
Undefined index: HTTP_HOST This occurs sometimes, is there a reliable method for determining the HTTP_HOST. Not sure if this is something related to Apache or if it's a problem with the version of PHP. Apache version 1.3.37 PHP version 5.2.4 I'm currently searching for an upgrade to Apache.
2
14428
by: klehonia | last post by:
Hi, i have a php server on iis6 win2003. When i write in index.php <? phpinfo(); ?> it brings me the information of php server _SERVER the name of localhost, but when i write the variable $_SERVER i get an error PHP Notice: Undefined index: SERVER_NAME. Any ideas please? Is something to do with the php.ini or with the environment variables like DOCUMENT_ROOT? Thank you.
0
9487
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
9297
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
10069
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9904
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
9884
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
9735
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
6556
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5168
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...
1
3828
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

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.