Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

For certain Restful URIs I want to block certain domains from executing the requests. How can i do this with Apache? Is it possible

For example:

  1. www.nottrusted.com calls my Restful Api
  2. Apache identifies the request is coming from a non-authorized site
  3. Apache blocks the caller and returns a 401

Is this possible? Is it easy for someone one spoof the domain? If a request comes from server side code of nottrusted.com will Apache catch the request?

share|improve this question
This sort of issue should really be handled at the code level. –  John Gardeniers Dec 6 '12 at 11:25
Ideally it would be handled at the code level however when the URL's are not password protected i need an alternative. A lot of the time the URLs will be invoked pro grammatically through JavaScript so a login page is not an option. –  user18910 Dec 7 '12 at 10:17

1 Answer 1

use mod_authz_host, refer to this documentation http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.