Questions tagged [http-host]

The "host" HTTP header is set by the client to indicate the virtual host that should be used to fulfil the request.

70 questions
170
votes
5 answers

Invalid http_host header

I am trying to develop a website using Django framework and launched using DigitalOcean.com and deployed the necessary files into django-project. I had to include static files into Django-project and After collecting static files, I tried to refresh…
Kathiravan Natarajan
  • 3,158
  • 6
  • 22
  • 45
69
votes
13 answers

How to disable Django's invalid HTTP_HOST error?

Ever since I deployed a site running Django 1.7 alpha (checked out from Git), I've been occasionally receiving error messages with titles like: "Invalid HTTP_HOST header: 'xxx.xxx.com'" I realize that this is due to the Host: HTTP header being set…
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
25
votes
4 answers

Django ERROR (EXTERNAL IP): Invalid HTTP_HOST header: '*.domain.com'

I've create a Django (1.7) web application with a Nginx, Gunicorn, Django stack and recently I've started to get a number of errors: [Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: '*.domain.com'. The domain name provided is not valid…
tdsymonds
  • 1,679
  • 1
  • 16
  • 26
21
votes
3 answers

What causes HttpHostConnectException?

I have a Auto Complete/type ahead feature on Search for my website. I see that some time their is an exception associated with it. We are using a proxy server. org.apache.http.conn.HttpHostConnectException: Connection to http://proxy.xyz.com:60…
pushya
  • 4,338
  • 10
  • 45
  • 54
15
votes
3 answers

What's the difference between ServerVariables["HTTP_HOST"] and ServerVariables["SERVER_NAME"]?

I'm confused about the difference between these two server variables. Checking the IIS documentation, it states :- HTTP_HOST Returns the name of the Web server. This may or may not be the same as SERVER_NAME depending on type of name resolution you…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
11
votes
2 answers

Apache mod_rewrite: explain me %{HTTP_HOST} especially when using addon domains

Apache mod_rewrite: explain me %{HTTP_HOST} expecially when using addon domains Situation (directories tree) on an Apache server with addon domains: main-domain.com/ | |_ .htaccess (just an empty file, no rule in here) |_ index.html (shown when…
Marco Demaio
  • 33,578
  • 33
  • 128
  • 159
9
votes
5 answers

How reliable is HTTP_HOST?

I have written a PHP script that I would like to use on several domains on the same server (pointing to same script). I want to add functionality to the script so I can find out which domain the script is working with at any time. HTTP_HOST can be…
user427165
6
votes
2 answers

Is it possible to change the $_SERVER['HTTP_HOST'] in htaccess?

I have a sub-domain ABC.mydomain.com whose $_SERVER['HTTP_HOST'] I would like to change to another domain anotherdomain.com. Anotherdomain.com is one that I own too. Is it possible to globally change this variable ($_SERVER['HTTP_HOST']) using…
Daniel Morgan
  • 79
  • 1
  • 1
  • 3
5
votes
5 answers

Is it possible that Request.ServerVariables["HTTP_HOST"].ToString() can return a different host than what I see in the url bar

Say I have a remote page accessed through http://www.mypage.com/test.aspx. On that page I use the code Request.ServerVariables["HTTP_HOST"].ToString(). Is it possible that when I access the page the code can return a different url than that which I…
Ben
  • 784
  • 3
  • 12
  • 32
4
votes
4 answers

SetEnvIf HTTP_HOST not working

I can't get it work this part of .htaccess, the IfDefine never runs. What am I doing wrong, setenvif mod is enabled. RewriteBase / SetEnvIf HTTP_HOST ^localhost$ local RewriteBase /codeigniter-app/ SetEnvIf HTTP_HOST…
Alex
  • 7,538
  • 23
  • 84
  • 152
4
votes
0 answers

Can't use {HTTP_HOST} for multiple rewrite rules in web.config file with GoDaddy Hosting - IIS 7.0

I came across a weird issue while creating a few rewrite rules for my website which is hosted by GoDaddy. I'm able to create one rewrite rule using the {HTTP_HOST} or {SERVER_NAME} variables, but at the time of adding a second rule, it looks like…
4
votes
1 answer

How to tell if a request comes from browser or server?

Is there a reliable way to tell if a request to your site came from a server-to-server call vs a browser url call? For example, Paypal IPN is a server-to-server call. But you could also fake it by calling it direct from a url with parameters from…
Dss
  • 2,162
  • 1
  • 24
  • 27
3
votes
1 answer

What is the .net core version of HttpContext.Current.Request.ServerVariables["HTTP_HOST"]

I am trying to rewrite this line of code HttpContext.Current.Request.ServerVariables["HTTP_HOST"] it cant find current it doesn't contain a definition.
Spafa9
  • 742
  • 3
  • 14
  • 30
3
votes
1 answer

Reliability of php HTTP_HOST & HTTP_REFERER for critical task

I'm going to develop a website in PHP. But not sure if the method i'm going to use is the best approach. There will be many addon domains for the same site. But content will be filtered based on the domain used to visit the site. For Example If a…
esafwan
  • 17,311
  • 33
  • 107
  • 166
2
votes
0 answers

Set HTTP_HOST server variable in ASP.NET (4.7) MVC behind reverse proxy in Azure

I inherited an older .NET 4.7 MVC application that is hosted in Azure and sat behind a reverse proxy (Application Gateway). Rewrite rules were setup to get it working using the right domain when requests are forwarded from the reverse proxy, this…
AnimaSola
  • 7,146
  • 14
  • 43
  • 62
1
2 3 4 5