I'm building an API which will only be accessible to local services by using Require local in the <Location> directive. How can I make this return a 404 rather than 403 status code when accessed from a remote address? That way I can hide the fact that there is a service at the requested location.

I'd rather preserve the semantics of Require local than use mod_rewrite.


Turns out this isn't too difficult:

ErrorDocument 403 /unauthorized_remote_access
Redirect 404 /unauthorized_remote_access

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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