The "host" HTTP header is set by the client to indicate the virtual host that should be used to fulfil the request.
Questions tagged [http-host]
70 questions
1
vote
1 answer
Apache proxy to Lighttpd: changing $_SERVER['HTTP_HOST'] in php
I have a WordPress blog running on lighttpd-1.4.19, listening at www00:81. On the same host, apache-2.2.11 listens on port 80, which creates a proxy connection from http://blog.mydomain.org:80 to http://blog.mydomain.org:81 (both being the same…

watain
- 4,838
- 4
- 34
- 35
1
vote
2 answers
Request.ServerVariables["HTTP_HOST"] is null or empty
This is an ASP.NET 2.0 website on IIS 7.5. Below is my global.asax. It has BeginRequest and a static method.
Does anybody see any issue with Request.ServerVariables["HTTP_HOST"] being null or empty?
Global.asax:
<%@ Application Language="C#"…

gbs
- 7,196
- 5
- 43
- 69
1
vote
2 answers
Undefined index: $_SERVER['HTTP_HOST'] Openshift scalable app
I have an scalable app in openshift and I'm having problems trying to access the PHP $_SERVER variables.
I am just trying to do "$domain = str_replace("www.", "", $_SERVER['HTTP_HOST']);" but got the error
undefined index HTTP_HOST
, this works…

user3405057
- 43
- 4
1
vote
1 answer
.htaccess redirect with host and ip address
Hello ~ this is my first post to stackoverflow
We are trying to satisfy the following criteria in our htaccess file:
If you are not in a certain range of IP addresses (111.222.xxx.xxx) and the http host is test.com, then take the user to…

user1967926
- 13
- 3
1
vote
1 answer
How can I tread OpenDolphin client send HttpHostConnectException?
Is there way to handle situation when message is not delivered to server? Dolphin log infors about situation clearly, but I'would like to catch it from code. I was looking for some method like: onError to override like…

Václav
- 365
- 2
- 15
1
vote
2 answers
Get in wsgi.py apache virtualhost name
I have apache settings:
ServerName site1.ru
ServerAlias site2.ru
WSGIScriptAlias / /path/to/wsgi.py
..
I want to load some host specific settings to django settings. So, how can i get HTTP_HOST (site1.ru or site2.ru)…

khramov
- 15
- 3
1
vote
1 answer
Unusual HttpHostConnectException on device
I am getting a really weird error. Trying to solve it nearly for 5 hours, but I'm hopeless now.
I'm developing an android application that connects to localserver, and receive some data. I am using my own phone instead of emulator. Everything was…

mamba4ever
- 2,662
- 4
- 28
- 46
1
vote
1 answer
IP address in HTTP_HOST
I have a drupal site where I use the domain access module that works using inbound HTTP_HOST variable.I have to create some subdomain's also.To make this module work properly the $_SERVER['HTTP_HOST'] variable should have the domain name in it .But…

ktrev
- 37
- 3
- 9
1
vote
2 answers
Print file name of including file, not included
I have example1.php and example2.php that include example3.php. In example3.php I have:
What I wanted is to have example1.php/example2.php in href dependent on the…

MultiformeIngegno
- 6,959
- 15
- 60
- 119
1
vote
2 answers
Redirection for Mobile using .htaccess - only on homepage
I started by using the method described here in order to create a Mobile redirect, and it works perfectly.
What I need to do next, however, is prevent it from happening on any page other than the homepage. In other words: If the user loads the…

hdwebpros
- 528
- 3
- 7
- 20
0
votes
1 answer
How is the HTTP host header resolvable?
I am working on making a web server with java.
The task is...
The Host header of HTTP/1.1 must be resolvable.
For example, the web server implementing the request of a.com and b.com should be able to provide different data depending on the…

othello
- 1
- 1
0
votes
1 answer
Nginx: Need a map function for domain of http_name
We would need the domain part of the requested host.
F.e.: If www1.domX.here is the requested host, we would need domX.here in variable.
Not working:
map $http_host $this_dom {
default $http_host;
~^www1\.(?)$…

Markus N.
- 312
- 2
- 7
0
votes
0 answers
apache wrong HTTP_HOST and SERVER_NAME in .htaccess but correct in php
I have an apache web server, version: Apache/2.4.34 (Red Hat), on it I have multiple virtual hosts
now, in .htaccess, I have a redirect to cut the trailing slashes, but there, the variables HTTP_HOST and SERVER_NAME are always loaded with default…

TTudor
- 1
- 2
0
votes
1 answer
apache redirect in https from none www to www domain
Edit:
Redirect permanent "/" "https://%{HTTP_HOST}/" actually doesn't work in the first redirect. It appeared to work because my CDN automatically redirected http to https:, not because of my settings. Sorry for the confusion.
I am trying to write…

O.Counts
- 5
- 4
0
votes
0 answers
How Can I detect and filter http_host on Nginx
I have been doing some research on nginx for http_host. Somebody steals my content and I am trying to block it.
For example my website is www.mywebsite.com and a website www.thiefsite.com steals my content which I think is a proxy site. Whenever I…

Cyber
- 1
- 2