Return error code for a <Location>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear experts,

I was half-expecting to find that there was something like this:

<Location />
  ErrorCode 404
</Location>

that would make Apache return a particular error response for all matching requests. But I can't see anything; maybe I've overlooked something?

Here's the application: I have a server with name-based virtual hosts. Some of my domains are email-only and I don't want Apache to serve up anything for them; I was recently surprised to find that it defaults to the first-listed virtual host when it doesn't recognise the hostname. To work around this, I have put an explicit default virtual host before the real ones:

<VirtualHost 1.2.3.4:80>
  <Location />
    ... return 404, or similar, please ....
  </Location>
</VirtualHost>

But how to return the error code?  I currently have something like this:

<VirtualHost 1.2.3.4:80>
  DocumentRoot /does/not/exist
</VirtualHost>

which feels bad, if you know what I mean. (It's also untested, as I have to wait for a DNS change to propogate before I can see if it has worked.)

Any suggestions?

Thanks,  Phil.




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux