Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have media content on a hosted server that I want to be accessed by another domain.

In the configuration file, even if I "Allow from all," all hosts except itself will fetch the hosting company's generic landing page, which puzzles me.

I test it with curl, with the command:

curl -H "Host:"

and it just shows the hosting company's page.

If I do:

curl -H "Host:"

it will show my content.

How do I allow other hosts to access my content? I thought it would work with "Allow" in .htaccess, but it doesn't.

share|improve this question

Read up on http host headers. It's doing exactly what it should. You need to have your hosting company add another host header for your new domain.

share|improve this answer
ah, the Host: header is meant to tell the server what host you are looking for, instead of reading it from the URL, right? it's not in anyway like the referrer +1 – cpbills May 18 '10 at 2:44

a few assumptions

running apache on a linux box

check the httpd.conf as there is a default config that limits the "Allow" to localhost, plus the default config does not enable overrides (.htaccess files)

share|improve this answer

is the domain name new? it sounds to me like the DNS records haven't quite propagated and is still pointing to the hosting site's parked domain.

try doing dig to see what information comes up, and if that is accurate. also, try going right to the ip address of your webhost.

as Mark pointed out, Host headers don't do what you think they do, you're telling your server that you want the page for not that you are browsing from

if you're still having problems browsing your site, i strongly suspect it's DNS 'propagation' issues.

share|improve this answer

On a Linux box? Check your /etc/hosts. The server has (probably) bound the listening address by hostname, which may (probably) be pointing at a 127.0.x.x address - try adding local entry by hostname for the real IPs of the machine and restarting the process.

Mark and cpbills are right that the Host header is probably causing you grief but this a good thing to check regardless as it can be a cause of the symptoms you describe.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.